from typing import TypeVar, Generic
from multimethod import multimethod
T = TypeVar('T')
class A(Generic[T]):
pass
class B:
pass
@multimethod
def func(a: A[B]):
pass
func(A[B]())
It crashes with multimethod.DispatchError: ('func: 0 methods found', (<class '__main__.A'>,), []).
Whereas without the annotation everything works fine.
Consider this example:
It crashes with
multimethod.DispatchError: ('func: 0 methods found', (<class '__main__.A'>,), [])
.Whereas without the annotation everything works fine.