-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FeatReq] support for literal types #66
Comments
Hey @PabloLION! I'm planning a rework of the internals of the package, which should make support for |
@PhilipVinc I didn't knew this after reading the docs😂 and I searched the docs too. Maybe add a reference of "Literal" to the page https://wesselb.github.io/plum/api.html#plum.parametric.Val to for searching index? For me personally,
|
@PhilipVinc, @dispatch
def f(x: Val[True]):
print("Got the literal `True`!") Then this is the behaviour:
However, for a function, @dispatch
def f(x: Literal[True]):
... the wrapping in With the current design, which assumes that all information necessary for dispatch is contained in the types of the arguments, |
This seems to be mentioned in the discuss of #53 (comment)
While I was trying to dispatch with
typing.Literal[True]
it fails.Can we add this functionality?
TIA.
The text was updated successfully, but these errors were encountered: