[Python-3000] Type annotations: annotating generators

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sun May 21 11:15:29 CEST 2006


Nick Coghlan <ncoghlan at gmail.com> writes:

> Assume the following is true for a type annotation system:
>    (T,) is equivalent to tuple[T]
>    (T1, T2) is equivalent to tuple[T1, T2]
>    (T1, T2, T3) is equivalent to tuple[T1, T2, T3]

This is ambiguous: tuple[T1, T2] is the same as tuple[(T1, T2)],
i.e. it's a 1-tuple containing a 2-tuple.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Python-3000 mailing list