Syntax disagreement between IDLE and pydev?

Benjamin Kaplan benjamin.kaplan at case.edu
Mon Mar 30 21:07:31 CEST 2009


On Mon, Mar 30, 2009 at 2:23 PM, Jim Garrison <jhg at acm.org> wrote:

> Jim Garrison wrote:
>
>> IDLE (3.1a1) accepts
>>
>>    a,*b = re.split(str,pattern)
>>
>> and does the right thing ('a' gets the first result and 'b' gets
>> the rest).
>>
>> pydev configured to use the exact same Python 3.1a1 runtime doesn't
>> like this syntax (in my source, column 23 is the asterisk):
>>
>> Encountered "*" at line 32, column 23. Was expecting one of: <NEWLINE> ...
>>     ";" ...     "=" ...
>>  "+=" ...     "-=" ...     "*=" ...     "/=" ...     "//=" ...     "%="
>> ...     "&=" ...     "|=" ...     "^=" ...
>>  "<<=" ...     ">>=" ...     "**=" ...     "lambda" ...     "not" ...
>>  "+" ...     "-" ...     "~" ...     "(" ...
>>  "[" ...     "{" ...     "False" ...     "True" ...     "None" ... <NAME>
>> ...     <HEXNUMBER> ...
>>  <OCTNUMBER> ...     <DECNUMBER> ...     <FLOAT> ...     <COMPLEX> ...
>>  "\'" ...     "\"" ...
>>  "\'\'\'" ...     "\"\"\"" ...     "\'" ...     "\"" ...     "\'\'\'" ...
>>     "\"\"\"" ...
>>
>> Can I assume pydev is wrong or am I missing something?
>>
>
> I should add that this seems to affect only the occurrence of the
> syntax error marker (red X and red underline). The code runs
> correctly.
>

Pydev does its own syntax checking. You probably have the grammar version
set to 2.5 or 2.6, so the syntax checker doesn't like it, but then run it
through the Python 3 interpreter. Go to the project's properties and under
Pydev- Project Type, change the grammar version to 3.0.


>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090330/5e9c44ab/attachment.html>


More information about the Python-list mailing list