I have a problem with how __extra__ is currently inherited:
>>> class CustomMapping(typing.Mapping): ...
...
>>> issubclass(dict, CustomMapping)
True
>>> class CustomDict(typing.Dict): ...
...
>>> issubclass(dict, CustomDict)
True
This can't be right.
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?
I have a problem with how
__extra__is currently inherited:This can't be right.
My initial impression is that
__extra__should only be propagated on parameterization, not when subclassing, and that the concrete typesList,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:
3.5.0:
And finally, a question: The
collectionsABC replacements do not provide the abstract (or any other) methods of the originals. In particular,Iterableis technically not abstract at all. Is this intentional or just a temporary state of affairs?