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
classFoo:
@multimethoddefbar(cls, x: str):
print(cls, str)
@classmethod# <- only put this @classmethod here on the final definition@bar.registerdef_(cls, x: int):
print(cls, int)
Foo().bar(10) # okFoo.bar(10) # DispatchError: ('bar: 0 methods found', (<class 'int'>,), [])
The text was updated successfully, but these errors were encountered:
classmethod can not be used with register because register returns the original function, not the multimethod. The example has been updated to demonstrate explicitly calling classmethod.
version: dev
python: 3.10.12
The text was updated successfully, but these errors were encountered: