Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Syntax disagreement between IDLE and pydev?

2009-03-30
2013-03-15
  • James Garrison
    James Garrison
    2009-03-30

    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 flags this
    as a syntax error:

    Encountered "*" at line 32, column 23. Was expecting one of: <NEWLINE> ...     ";" ...     "=" ...
    "+=" ...     "-=" ...     "*=" ...     "/=" ...     "//=" ...     "%=" ...     "&=" ...     "|=" ...     "^=" ...
    "<<=" ...     ">>=" ...     "**=" ...     "lambda" ...     "not" ...    "+" ...     "-" ...     "~" ...     "(" ...
    "[" ...     "{" ...     "False" ...     "True" ...     "None" ... <NAME> ...     <HEXNUMBER> ...
    <OCTNUMBER> ...     <DECNUMBER> ...     <FLOAT> ...     <COMPLEX> ...     "\'" ...     "\&quot;" ...
    "\'\'\'" ...     "\&quot;\&quot;\&quot;" ...     "\'" ...     "\&quot;" ...     "\'\'\'" ...     "\&quot;\&quot;\&quot;" ...

    HOWEVER, I can execute the code without problems.

    Should I file a bug?

     
    • Fabio Zadrozny
      Fabio Zadrozny
      2009-03-30

      > Should I file a bug? 

      No, this has already been fixed for 1.4.5 (provided you set your project as python 3.0). You can get the nightly and check it (as that should be the released version: http://pydev.blogspot.com/2009/03/new-pydev-release-soon-call-for-testers.html )

      Cheers,

      Fabio

       
    • James Garrison
      James Garrison
      2009-03-30

      Wow! Thanks for the quick response.

      I installed the nightly and it now works.

       
    • James Garrison
      James Garrison
      2009-03-31

      This is back after installing the pydev-extensions version (also at 1.4.5.2720).

      Looks like some fixes didn't make it into the extensions version build?

       
      • Fabio Zadrozny
        Fabio Zadrozny
        2009-04-01

        It seems to work for me... are you sure that the project you're editing is marked with a Python 3.0 grammar?

        Cheers,

        Fabio

         
    • James Garrison
      James Garrison
      2009-04-01

      The project grammar is set to Python 3.0

      Versions: 

      Python 3.1a1
      pydev 1.4.5.2720
      pydev-extensions 1.4.5.2720

      This was resolved until I installed pydev-extensions. See also my other thread "pydev extensions - spurious syntax errors"

       
      • Fabio Zadrozny
        Fabio Zadrozny
        2009-04-01

        Are you sure it's the same error?

        Cheers,

        Fabio

         
    • James Garrison
      James Garrison
      2009-04-01

      It's on the same line but you're right. The error is now "undefined variable" on "b".

      In any event, the code hasn't changed and the error started showing up after installing pydev-extensions.

       
      • Fabio Zadrozny
        Fabio Zadrozny
        2009-04-02

        You're totally right. That's a bug when treating the StarExp. It was creating a name in the Load context when it should be a Store context (which the Pydev Code Analysis made visible).

        I've just fixed that -- it's available for svn 2722 (so, please wait for a build with at least that number and check it again with the extensions).

        Cheers,

        Fabio

         
    • James Garrison
      James Garrison
      2009-04-02

      The new error still occurred after updating to 2721, but went away after I removed pydev-extensions