[issue39550] isinstance accepts subtypes of tuples as second argument

2020-02-04 Thread STINNER Victor
STINNER Victor added the comment: Joachim: > It's possible to use a tuple subclass, though, and while it doesn't break the > function because it reads , the tuple is not explored through the __iter__ > interface: (...) I don't think that the example from the first message is an issue in

[issue39550] isinstance accepts subtypes of tuples as second argument

2020-02-04 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39550] isinstance accepts subtypes of tuples as second argument

2020-02-04 Thread Paul Ganssle
Paul Ganssle added the comment: Serhiy: I think at least a test for this particular corner case should be added, so that no implementations of `isinstance` that use the CPython test suite hit an infinite recursion in that event, I guess? Though I think it's maybe an open question as to what

[issue39550] isinstance accepts subtypes of tuples as second argument

2020-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not understand what the problem is. If the isinstance tuple iteration were to start using __iter__ in the future, it should start to handle all corner cases. But what is wrong now? -- nosy: +serhiy.storchaka

[issue39550] isinstance accepts subtypes of tuples as second argument

2020-02-04 Thread Joachim Jablon
New submission from Joachim Jablon : (Not really sure it is a bug, but better informed people might find it worthy still) isinstance can accept, as second argument, a type or a potentially nested tuple of types. Only tuples are accepted, as opposed to generic iterables. The reasoning behind