4040probeIndexer = _NameIndexer ("Probe-" )
4141
4242
43- def probe (w : WireVector , name : str = None ) -> WireVector :
43+ def probe (w : WireVector , name : str | None = None ) -> WireVector :
4444 """Print useful information about a :class:`WireVector` in debug mode.
4545
4646 ``probe`` can be inserted into a existing design easily because it returns the
@@ -272,7 +272,7 @@ def __exit__(self, *execinfo):
272272
273273
274274def match_bitpattern (
275- w : WireVector , bitpattern : str , field_map : dict [str , str ] = None
275+ w : WireVector , bitpattern : str , field_map : dict [str , str ] | None = None
276276) -> MatchedFields :
277277 """Returns a single-bit :class:`WireVector` that is ``1`` if and only if ``w``
278278 matches the ``bitpattern``, and a tuple containing the matched fields, if any.
@@ -587,7 +587,9 @@ def chop(w: WireVector, *segment_widths: int) -> list[WireVector]:
587587 return [w [s :e ] for s , e in zip (starts , ends )]
588588
589589
590- def input_list (names : str | list [str ], bitwidth : int | list [int ] = None ) -> list [Input ]:
590+ def input_list (
591+ names : str | list [str ], bitwidth : int | list [int ] | None = None
592+ ) -> list [Input ]:
591593 """Allocate and return a list of :class:`Inputs<Input>`.
592594
593595 See :func:`wirevector_list`. Equivalent to::
@@ -608,7 +610,7 @@ def input_list(names: str | list[str], bitwidth: int | list[int] = None) -> list
608610
609611
610612def output_list (
611- names : str | list [str ], bitwidth : int | list [int ] = None
613+ names : str | list [str ], bitwidth : int | list [int ] | None = None
612614) -> list [Output ]:
613615 """Allocate and return a list of :class:`Outputs<Output>`.
614616
@@ -630,7 +632,7 @@ def output_list(
630632
631633
632634def register_list (
633- names : str | list [str ], bitwidth : int | list [int ] = None
635+ names : str | list [str ], bitwidth : int | list [int ] | None = None
634636) -> list [Register ]:
635637 """Allocate and return a list of :class:`Registers<Register>`.
636638
@@ -653,7 +655,7 @@ def register_list(
653655
654656def wirevector_list (
655657 names : str | list [str ],
656- bitwidth : int | list [int ] = None ,
658+ bitwidth : int | list [int ] | None = None ,
657659 wvtype : type [WireVector ] = WireVector ,
658660) -> list [WireVector ]:
659661 """Allocate and return a list of :class:`WireVectors<WireVector>`.
@@ -908,7 +910,7 @@ class ValueBitwidthTuple(NamedTuple):
908910
909911
910912def infer_val_and_bitwidth (
911- rawinput : int | bool | str , bitwidth : int = None , signed : bool = False
913+ rawinput : int | bool | str , bitwidth : int | None = None , signed : bool = False
912914) -> ValueBitwidthTuple :
913915 """Return a ``(value, bitwidth)`` :class:`tuple` inferred from the specified input.
914916
@@ -967,7 +969,7 @@ def infer_val_and_bitwidth(
967969
968970
969971def _convert_bool (
970- bool_val : bool , bitwidth : int = None , signed : bool = False
972+ bool_val : bool , bitwidth : int | None = None , signed : bool = False
971973) -> ValueBitwidthTuple :
972974 if signed :
973975 msg = "error, booleans cannot be signed (convert to int first)"
@@ -982,7 +984,7 @@ def _convert_bool(
982984
983985
984986def _convert_int (
985- val : numbers .Integral , bitwidth : int = None , signed : bool = False
987+ val : numbers .Integral , bitwidth : int | None = None , signed : bool = False
986988) -> ValueBitwidthTuple :
987989 # Convert val from numbers.Integral to int. This avoids issues with
988990 # limited-precision types like numpy.int32.
@@ -1026,7 +1028,7 @@ def _convert_int(
10261028
10271029
10281030def _convert_verilog_str (
1029- val : str , bitwidth : int = None , signed : bool = False
1031+ val : str , bitwidth : int | None = None , signed : bool = False
10301032) -> ValueBitwidthTuple :
10311033 if signed :
10321034 msg = 'error, "signed" option with Verilog-style string constants not supported'
@@ -1981,7 +1983,7 @@ def __init__(
19811983 block : Block = None ,
19821984 concatenated_type = WireVector ,
19831985 component_type = WireVector ,
1984- values : list = None ,
1986+ values : list | None = None ,
19851987 ):
19861988 # The concatenated WireVector contains all the _WireMatrix's wires.
19871989 # WrappedWireVector (base class) will forward all attribute and
@@ -2144,7 +2146,7 @@ def one_hot_to_binary(w: WireVectorLike) -> WireVector:
21442146
21452147
21462148def binary_to_one_hot (
2147- bit_position : WireVectorLike , max_bitwidth : int = None
2149+ bit_position : WireVectorLike , max_bitwidth : int | None = None
21482150) -> WireVector :
21492151 """Given a ``bit_position``, return a :class:`WireVector` with only that bit set to
21502152 ``1``.
0 commit comments