[Python-ideas] PEP 484 (Type Hints) -- first draft round

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 20 07:12:33 CET 2015

Guido van Rossum wrote:
> On Mon, Jan 19, 2015 at 12:30 PM, Devin Jeanpierre 
> <jeanpierreda at gmail.com <mailto:jeanpierreda at gmail.com>> wrote:
>     I like the :: idea.
> Blechh. It smells of C++ and syntax hacks.

That smells like a knee-jerk reaction to me. Just
because you've had bad experiences with it in C++
doesn't mean the symbol itself is inherently evil.

But there are alternatives. We could borrow 'as'
from a certain other language:

   num_feathers as int = 0

Or exploit the fact that '{' following an identifier
is currently undefined:

   num_feathers {int} = 0


More information about the Python-ideas mailing list