[Python-ideas] Variable-length, homogeneous tuple: why? (was: Optional static typing -- the crossroads)

Chris Angelico rosuav at gmail.com
Mon Aug 18 01:59:24 CEST 2014


On Mon, Aug 18, 2014 at 9:47 AM, Łukasz Langa <lukasz at langa.pl> wrote:
> - issubclass(tuple[int, int, int], frozenlist[int]) ?  I think True.
> - issubclass(frozenlist[int], tuple[int, int, int]) ?  I would think False.
> But because that's technically the same tuple underneath, *sometimes*
> instances of frozenlist[int] will respond True to isinstance(tuple[int, int,
> int]).

I would say False to both of those, because they have different
implications of intent. But it is arguable, so I'd be happy with the
first one being True if it's easier to code that way.

ChrisA


More information about the Python-ideas mailing list