[Python-3000] Type annotations: annotating generators
Collin Winter
collinw at gmail.com
Sat May 20 07:10:28 CEST 2006
On 5/19/06, Guido van Rossum <guido at python.org> wrote:
> OK; for the return value (only) the Function().returns(<type>)
> notation does look fairly pretty.
>
> I presume that return(int, int) is the same as return((int, int))?
It is.
> Weren't we going to write a tuple of two ints as tuple[int, int]
> though? Is (int, int) now just an alias for that or does it have a
> different meaing?
I think that returns() is smart enough to know that "returns((int,
int))" is the same as "returns(int, int)". It will know to do
something similar for "returns(tuple[int, int])".
Collin Winter
More information about the Python-3000
mailing list