[Python-Dev] Re: bug in grammar

Jeremy Hylton jeremy@alum.mit.edu
Thu, 18 Jan 2001 10:15:25 -0500 (EST)

If I summarize your suggestion, I think you've said that ideally the
grammar should not allow assignment to list comprehensions (or a
variety of other constructs) -- but it doesn't so the compiler has to
deal with it.

This morning it seemed a lot easier to fix the bug than it did last
night :-).  com_assign() already has a number of checks for syntax
errors in assignments.  A test for list comprehensions belongs at the
same place as tests for assignment to [] and augmented assignments
applied to lists.

I'll include a fix for assignment to list comprehensions in my big
compiler patch.