Syntax disagreement between IDLE and pydev?

J

Jim Garrison

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?
 
M

Mike Driscoll

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?

If it works that way in IDLE and from the command line python, then
it's almost proof positive that pydev goofed up.

Mike
 
J

Jim Garrison

Jim said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top