[Python-ideas] Trial balloon: adding variable type declarations in support of PEP 484

Guido van Rossum gvanrossum at gmail.com
Thu Aug 4 12:58:01 EDT 2016


On Thu, Aug 4, 2016 at 9:44 AM, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> BTW, a: int looks like an "incomplete" assignment to me.  It's a
> statement that under-specifies a: gives it a type, but not a value.
> Visually, ':' is a shorter version of '=' and a half of the venerable
> Pascal's ':='.  It all makes sense to me, but your milage may vary if
> your first language was JavaScript rather than ALGOL. :-)

Actually, I'm trying to keep some memories of Pascal. In Pascal you write:

var
  age: integer;

The family of languages derived from C is already doing enough to keep
the ALGOL tradition alive.

Anyways, "age: int" matches what you write in function signatures in
Python, so I think our hands are tied here and we might as well make
the most of it.

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-ideas mailing list