File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ def as_shape(cls):
118118 # replacement for `enum.Enum`.
119119 return Shape ._cast_plain_enum (cls )
120120
121- def __call__ (cls , value ):
121+ def __call__ (cls , value , * args , ** kwargs ):
122122 # :class:`py_enum.Enum` uses ``__call__()`` for type casting: ``E(x)`` returns
123123 # the enumeration member whose value equals ``x``. In this case, ``x`` must be a concrete
124124 # value.
@@ -130,7 +130,7 @@ def __call__(cls, value):
130130 # comparisons with enum members of the wrong type.
131131 if isinstance (value , Value ):
132132 return value
133- return super ().__call__ (value )
133+ return super ().__call__ (value , * args , ** kwargs )
134134
135135 def const (cls , init ):
136136 # Same considerations apply as above.
Original file line number Diff line number Diff line change @@ -116,3 +116,6 @@ class EnumA(Enum):
116116 r"shape used in bit vector context; define the enumeration by inheriting from "
117117 r"the class in amaranth\.lib\.enum and specifying the 'shape=' keyword argument$" ):
118118 Cat (EnumA .A )
119+
120+ def test_functional (self ):
121+ Enum ("FOO" , ["BAR" , "BAZ" ])
You can’t perform that action at this time.
0 commit comments