For review: PEP 308 - If-then-else expression

Michael Hudson mwh at python.net
Mon Feb 10 10:37:57 EST 2003


Erik Max Francis <max at alcyone.com> writes:

> I'm no Python parser expert,

Python parser is LL(1), but some bits of the grammar are more lenient
than the language spec and get thrown out in the compiler.

You can actually tell when this happens; 

>>> compile("1 = 2; '", "", "exec")

barfs at the illegal token, not the lexically preceding assignment to
literal, even though the interpreter will try and claim that was a
syntax error.

trivia-ly y'rs
M.

-- 
  : Giant screaming pieces of excrement, they are.
  I have a feeling that some of the people in here have a 
  MUCH more exciting time relieving themselves than I do.
                                       -- Mike Sphar & Dave Brown, asr




More information about the Python-list mailing list