Open Hendiadyoin1 opened 5 years ago
Same here, python 3.7
The downgrade of the typing module helped me (from the python repository) to version 3.5.2.2.
You can also forcefully ignore the typing module in the overloading module by assigning typing = None
after the 30th line in the file overloading.py
, but I think the typing module features will not be available.
such an unfortunately infomation ! we want use python3; this maybe an solution for overload: https://python3-cookbook.readthedocs.io/zh_CN/latest/c09/p20_implement_multiple_dispatch_with_function_annotations.html
The downgrade of the typing module helped me (from the python repository) to version 3.5.2.2. You can also forcefully ignore the typing module in the overloading module by assigning
typing = None
after the 30th line in the fileoverloading.py
, but I think the typing module features will not be available.
Same issue here. Downgrading all the way to 3.5 sounds like a major hassle.
I have the same issue. @bintoro If you ask me, this project should be archived, since it's not in active development and does not work for the newest versions of python.
я не знаю как это влияет но можно использовать _GenericAlias вместо TypingMeta будет работать
for some reason my program throws this error rooted in this lib. when i try to simply overload the init of my class. Code:
Error:
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:...\Python\Testing\quaternion.py", line 6, in
class Quaternion:
File "C:...\Python\Testing\quaternion.py", line 14, in Quaternion
def init(self, c: complex):
File "C:...\Python\Python37\lib\site-packages\overloading.py", line 65, in overload
__registry[fname] = overloaded(func)
File "C:...\Python\Python37\lib\site-packages\overloading.py", line 151, in overloaded
return register(dispatcher, func)
File "C:...\Python\Python37\lib\site-packages\overloading.py", line 199, in register
signature = get_signature(fn)
File "C:...\Python\Python37\lib\site-packages\overloading.py", line 441, in get_signature
types = tuple(normalize_type(type_hints.get(param, AnyType)) for param in parameters)
File "C:...\Python\Python37\lib\site-packages\overloading.py", line 441, in
types = tuple(normalize_type(type_hints.get(param, AnyType)) for param in parameters)
File "C:...\Python\Python37\lib\site-packages\overloading.py", line 468, in normalizetype
if not typing or not isinstance(type, typing.TypingMeta) or type_ is AnyType:
AttributeError: module 'typing' has no attribute 'TypingMeta'