You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature request comes courtesy @danielward27 at issue #368, who astutely noted that the @beartype decorator currently fails to support functools.partial objects. Notably, this questionable minimal example coercing the functools.partial class into a decorator:
frombeartypeimportbeartypefromfunctoolsimportpartial@beartype@partial(partial, b=2) # <-- WTH!?!? no way that actually works. no way...deffn(a, b=2):
returna+bfn(1) # <-- OMG!!!! @partial(partial, b=2) totally works. Mind. Is. Blown.
...currently raises this mostly unreadable exception:
i.e. to partially apply arguments to a decorator before wrapping. My double partial was a lazy proxy for that (since jit leads to an error anyway), but perhaps I chose a bad proxy, since this seems to work
This feature request comes courtesy @danielward27 at issue #368, who astutely noted that the
@beartype
decorator currently fails to supportfunctools.partial
objects. Notably, this questionable minimal example coercing thefunctools.partial
class into a decorator:...currently raises this mostly unreadable exception:
Just thinking about supporting this makes @leycec vomit all over himself. 🤮
The text was updated successfully, but these errors were encountered: