[spyder] pyflakes in python3 mode

203 views
Skip to first unread message

David Verelst

unread,
May 20, 2013, 10:05:11 AM5/20/13
to spyder
Hi,

Exciting to see Python 3 support is arriving for spyder in the default branch!

I am running Spyder from Hg source with python2 (on Arch Linux 64bit), and after pulling the recent python3 changes I realized that code checking with Pyflakes is suddenly in Python3 mode (rolling back to spyder 2.2 fixes this). Is there any way you can tell pyflakes whether the source code is written in python2 or python3? I couldn't find a reference anywhere in the spyder source.

Regards,
David

Jed Ludlow

unread,
May 25, 2013, 7:49:52 PM5/25/13
to spyderlib
David,

You may have already noticed this, but there is an issue on the tracker specific to this question:


Jed Ludlow

unread,
May 25, 2013, 7:52:00 PM5/25/13
to spyderlib
On Sat, May 25, 2013 at 5:49 PM, Jed Ludlow <jed.l...@gmail.com> wrote:
On Mon, May 20, 2013 at 8:05 AM, David Verelst wrote:
Hi,

Exciting to see Python 3 support is arriving for spyder in the default branch!

I am running Spyder from Hg source with python2 (on Arch Linux 64bit), and after pulling the recent python3 changes I realized that code checking with Pyflakes is suddenly in Python3 mode (rolling back to spyder 2.2 fixes this). Is there any way you can tell pyflakes whether the source code is written in python2 or python3? I couldn't find a reference anywhere in the spyder source.

Regards,
David

David,

You may have already noticed this, but there is now an issue on the tracker specific to this question:


Sorry, inadvertent key press combination caused my message above to leave before it was ready :). At any rate, I would suggest continuing the discussion on the issue tracker.

Jed

David Verelst

unread,
Jun 26, 2013, 4:43:58 PM6/26/13
to spyder
I have the impression that in the current code base
from __future__ import print_function
leads to pyflakes marking
print ""
as a syntax error in the editor when using python2. Further, the
scientific startup script also uses python3 print style statements. It
took me a while to realize this (when I sent the first mail on this
thread I didn't). Although I think this is a good practice knowing
that python3 adoption is growing rapidly know. However, shouldn't
users (especially first timers) be made aware of this in some fashion?
For example: an additional print statement in scientific_startup.py
stating that python3 style print statements are in effect?

Regards,
David
> --
> You received this message because you are subscribed to the Google Groups
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to spyderlib+...@googlegroups.com.
> To post to this group, send email to spyd...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spyderlib?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jed Ludlow

unread,
Jun 27, 2013, 1:03:41 AM6/27/13
to spyd...@googlegroups.com
On Wednesday, June 26, 2013 3:43:58 PM UTC-5, David wrote:
I have the impression that in the current code base
from __future__ import print_function
leads to pyflakes marking
print ""
as a syntax error in the editor when using python2. Further, the
scientific startup script also uses python3 print style statements. It
took me a while to realize this (when I sent the first mail on this
thread I didn't). Although I think this is a good practice knowing
that python3 adoption is growing rapidly know. However, shouldn't
users (especially first timers) be made aware of this in some fashion?
For example: an additional print statement in scientific_startup.py
stating that python3 style print statements are in effect? 

David,

You are correct that on the 2.3 development branch scientific_startup.py is importing the print_function for Python 2.7. It's a bug that needs to be addressed before 2.3 is released. I've opened issue 1465 to track it.

Jed

David Verelst

unread,
Jun 27, 2013, 7:57:23 AM6/27/13
to spyder
Great. I also opened issue 1467 since I assume that the pyflakes now flags print statements other than print() as syntax errors.

David



Jed

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages