You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My initial impression is that __extra__ should only be propagated on parameterization, not when subclassing, and that the concrete types List, Dict, etc. should have their own extras (list, dict, and so on). Thoughts? A tentative patch is here.
Another thing: The module distributed on PyPI still has the issue where a generic doesn't include itself in the subtype's MRO during parameterization. This was fixed for Python 3.5.1 in aab2c59. It would be great if we could get a more recent revision on PyPI as well.
3.5.1:
>>>issubclass(Iterable[int], Iterable)
True
3.5.0:
>>>issubclass(Iterable[int], Iterable)
False
And finally, a question: The collections ABC replacements do not provide the abstract (or any other) methods of the originals. In particular, Iterable is technically not abstract at all. Is this intentional or just a temporary state of affairs?
As for the abstract methods, adding __iter__ to Iterable seems to have no ill effects.
Container, Awaitable, and AsyncIterable and their derivatives are also affected — in other words everything that doesn't inherit from Sized or Hashable.
One option is to just copy everything over during class construction:
I would like to go slow here. I have other priorities (see #203 (comment)). I will eventually get to this but I'm not sure I want to rush anything into 3.5.2 beyond what's already on deck.
Activity
gvanrossum commentedon Apr 16, 2016
gvanrossum commentedon Apr 16, 2016
bintoro commentedon Apr 16, 2016
Thanks!
As for the abstract methods, adding
__iter__toIterableseems to have no ill effects.Container,Awaitable, andAsyncIterableand their derivatives are also affected — in other words everything that doesn't inherit fromSizedorHashable.One option is to just copy everything over during class construction:
gvanrossum commentedon Apr 18, 2016
I would like to go slow here. I have other priorities (see #203 (comment)). I will eventually get to this but I'm not sure I want to rush anything into 3.5.2 beyond what's already on deck.