Revamped generic class behavior to conform to updated PEP 484 #195
|
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