This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alex.gronholm
Recipients alex.gronholm, gvanrossum, lukasz.langa
Date 2016-01-10.12:57:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452430654.78.0.244173734721.issue26075@psf.upfronthosting.co.za>
In-reply-to
Content
>>> from typing import Union, Iterable
>>> Union[str, Iterable[int]]
typing.Iterable[int]

The union loses the "str" parameter because issubclass(str, collections.abc.Iterable) returns True and the check completely disregards generics.

Guido mentioned that issubclass() support for generic types should be going away. In the mean time, maybe the subclass check in typing.GenericMeta should be modified not to do it with types from Typing, but how can we accurately identify them?
History
Date User Action Args
2016-01-10 12:57:34alex.gronholmsetrecipients: + alex.gronholm, gvanrossum, lukasz.langa
2016-01-10 12:57:34alex.gronholmsetmessageid: <1452430654.78.0.244173734721.issue26075@psf.upfronthosting.co.za>
2016-01-10 12:57:34alex.gronholmlinkissue26075 messages
2016-01-10 12:57:33alex.gronholmcreate