[Python-3000] Type Expressions

Guido van Rossum guido at python.org
Fri Apr 21 20:33:04 CEST 2006


On 4/21/06, Paul Moore <p.f.moore at gmail.com> wrote:
> I'm not sure I follow the priority argument (except in a purely
> parser-technical sense, I guess).

I meant that everywhere else in Python, ';' inside parentheses is
illegal; ';' terminates a statement (and an error-correcting parser
could use a ';' inside parentheses as a clue that a close paren is
probably missing). I like this property because it aids readability by
humans.

There are a few operators that don't always have the same relative
priorities (e.g. ',' and 'in' -- in a for-statement, ',' binds more
tightly, but in an expression, 'in' binds more tightly) and those are
somewhat bothersome to me. The parser has no problems because it knows
in which context it is parsing; but it can make skimming code by
humans harder.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list