-
Notifications
You must be signed in to change notification settings - Fork 258
Be more precise about types vs. classes #214
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
Conversation
Clean update
Update from python/typing
Also remove the mention of issubclass in the description of Union, and add a note about this for other special constructs.
``T1`` and any of its subtypes, ``T2`` and | ||
any of its subtypes, and so on. In other words, values of all types | ||
``T1``, ``T2``, etc., and their subtypes are acceptable for | ||
an argument annotated by ``Union[T1, T2, ...]``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't defined "compatible" previously. Maybe you can avoid it and just use "supertype"? Or briefly define it here? (The IOW doesn't really do that IMO. :-)
Could you also review PEP 483? It's referenced from PEP 484 and while it isn't part of the standard it intends to explain the theory behind things without being so distracted by the mechanics of introducing typing into Python. |
I included your proposed changes. I tried to make the definition of It is good that you mentioned PEP 483. Actually, I already started working on extending PEP 483 along the following lines:
I think I could make a PR soon (probably next week). |
Thank! I've merged this downstream (in the peps hg repo) too. If you're going to edit PEP 483, the best approach may be to copy that here first and then to build on that. I'll do that now. |
(Done, and for good measure I've added PEP 482 too.) |
Thanks, indeed, it is a very good idea to have all the related PEPs here. |
Also remove the mention of issubclass in the description of Union, and add a note about this for other special constructs.