
On Thu, Aug 29, 2019 at 7:14 PM Andrew Barnert <abarnert@yahoo.com> wrote:
What about other constructs that take a tuple of types? Should try/except take sets? (Are there any others?)
Would anyone be surprised that isinstance/issubclass take a tuple or set of types but all those string methods take only a tuple, not a set, of strings? I think people would get over that quickly, there’d just be another entry in the StackOverflow Python FAQ list.
Yeah, we could gradually fix those over time based on feedback. Note that `except (E1, E2)` has the same concern as `isinstance(x, (T1, T2))` that we need to be careful not to dive into infinite recursion. Also a caveat: I'm participating in this discussion but that doesn't mean this will all happen (soon, or ever). It takes a lot of work to implement such changes: even if Python itself doesn't have to be changed, we'd still need to implement it in mypy, Pyre, PyCharm, Pytype, and who knows what else. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>