-
Notifications
You must be signed in to change notification settings - Fork 259
Issue using Protocol as a base class with Python 3.5.2 #734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you try this with a newer version? 3.5 is nearing its end of life, and the latest version is 3.5.9. The latest version for which I can find downloadable binaries is 3.5.4: https://www.python.org/downloads/release/python-354/ If your problem is specifically with 3.5.2, I'm not sure that we can do much for you unless you can come up with a fix (I don't even have 3.5 installed on my machine any more). |
Thank you @gvanrossum for the quick reply. I've verified that it works with 3.5.9 because it comes with newer Maybe we can just use def _generic_new(base_cls, cls, *args, **kwargs):
if cls.__origin__ is None:
return base_cls.__new__(cls)
else:
origin = cls._gorg
obj = base_cls.__new__(origin)
obj.__init__(*args, **kwargs)
return obj However, since Python 3.5 nearing its end of life maybe it's not worth it. We just have 3.5.2 baked in our Docker images. What is your advise? Submit a PR for |
I strongly advise you to upgrade your Python version. |
Uh oh!
There was an error while loading. Please reload this page.
Python: 3.5.2
OS: macOS Mojave
Seems that
_generic_new
implementation fromtyping_extensions
module is outdated or incorrect. Whentyping_extensions
relies on its own implementation of_generic_new
I get the following error.Script to reproduce:
Traceback:
In debugger:

The text was updated successfully, but these errors were encountered: