Traceback (most recent call last):
File "C:\Users\jared\Desktop\source_code\test_sdm.py", line 19, in <module>
Hello(1, 2, 3)
File "C:\Users\jared\AppData\Local\Programs\Python\Python39\lib\site-packages\multimethod\__init__.py", line 298, in __call__
func = self[tuple(func(arg) for func, arg in zip(self.type_checkers, args))]
File "C:\Users\jared\AppData\Local\Programs\Python\Python39\lib\site-packages\multimethod\__init__.py", line 284, in __missing__
for key in self.parents(types):
File "C:\Users\jared\AppData\Local\Programs\Python\Python39\lib\site-packages\multimethod\__init__.py", line 233, in parents
parents = {key for key in self if isinstance(key, signature) and key < types}
File "C:\Users\jared\AppData\Local\Programs\Python\Python39\lib\site-packages\multimethod\__init__.py", line 233, in <setcomp>
parents = {key for key in self if isinstance(key, signature) and key < types}
File "C:\Users\jared\AppData\Local\Programs\Python\Python39\lib\site-packages\multimethod\__init__.py", line 169, in __lt__
return self != other and self <= other
File "C:\Users\jared\AppData\Local\Programs\Python\Python39\lib\site-packages\multimethod\__init__.py", line 166, in __le__
return len(self) <= len(other) and all(map(issubclass, other, self))
TypeError: issubclass() arg 2 must be a class or tuple of classes
Should we consider interpreting PositiveInt as PositiveInt.__supertype__ (which is int)?
Python 3.9, when I define such a custom type
and use it to annotate methods, the code breaks:
Should we consider interpreting
PositiveInt
asPositiveInt.__supertype__
(which isint
)?