-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
While implementing part of pact I ran into a situation where it would be helpful to be able to construct terms of type Literal[...] fixed set of values.
from effectful.ops.syntax import defop, NotHandled
@defop
def Price() -> Literal[5,10,20,50,80,120,150,200]:
raise NotHandled
Price()Currently this fails with an error about __mro__:
File "/Users/kirancodes/Documents/code/effectful/effectful/ops/syntax.py", line 515, in apply_cast
return __dispatch(dispatch_type)(dispatch_type, op, *args, **kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^
...
File "/Users/kirancodes/.local/share/uv/python/cpython-3.13.9-macos-aarch64-none/lib/python3.13/functools.py", line 765, in _compose_mro
bases = set(cls.__mro__)
^^^^^^^^^^^
AttributeError: __mro__. Did you mean: '__or__'?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request