-
Notifications
You must be signed in to change notification settings - Fork 256
Revamped generic class behavior to conform to updated PEP 484 #195
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
Still need to backport to python2.
(Backport of 3819cbc, CPython issue #25665.)
It looks great! Still I have found something that I think could be confusing. First, I would expect that Second (maybe related) issue is that now |
Ah, yes. I thought of making Ditto for repr(). The one important thing about repr() is that when you have
then repr(C) shows Anyway, thanks for the encouragement. I hope others look over this important change too! I intend to land this in Python 3.5.2 (whenever it is released). |
I am now thinking about one additional thing that might be not completely clear: covariance. If I initially have class C(Iterable[Tuple[T,S]]):
... then one could be not sure whether |
Good point. IMO nothing having to do with variance is obvious, so it would
be good to spell it out. Right now I'm too tired to reason this through
with a few examples, but my intuition says that your "natural" answer is
probably correct. When I feel more rested I'll figure this out and add it
to the PEP.
|
I just noticed that this PR also fixes #129 . In general, I think this new "revamped" behavior is much better than the old one. |
Fixes #115