-
Notifications
You must be signed in to change notification settings - Fork 263
Closed
Description
Python: 3.5.2
OS: macOS Mojave
Seems that _generic_new
implementation from typing_extensions
module is outdated or incorrect. When typing_extensions
relies on its own implementation of _generic_new
I get the following error.
Script to reproduce:
import abc
from typing_extensions import Protocol, runtime_checkable
@runtime_checkable
class Proto(Protocol):
@abc.abstractmethod
def foo(self):
pass
class SomeClass(Proto):
def __init__(self, some_arg):
pass
def foo(self):
return 5
x = SomeClass(3)
Traceback:
Traceback (most recent call last):
File "/Users/dikobraz/repro.py", line 20, in <module>
x = SomeClass(3)
File "/Users/dikobraz/env-py-3.5-tf-2/lib/python3.5/site-packages/typing_extensions.py", line 1357, in __new__
return _generic_new(cls.__next_in_mro__, cls, *args, **kwds)
File "/Users/dikobraz/env-py-3.5-tf-2/lib/python3.5/site-packages/typing_extensions.py", line 87, in _generic_new
return base_cls.__new__(cls, *args, **kwargs)
TypeError: object() takes no parameters
Metadata
Metadata
Assignees
Labels
No labels