Hi there,

I've hit a little issue when writing a multiline statement in spyder and I 
was wondering if this is something undesirable (i.e., a bug) or if I'm 
doing something wrong.  It happened when I was editing a longer than usual 
list comprehension and decided to break it up in multiple lines to stay 
under the 78-characters limit.  I have simplified the code to this.  
Suppose you have the following lines:

a = [n for n in range(100) 
     if n != 0
     and n % 5 == 0]

and you want to add yet another condition after the second line, like this:

a = [n for n in range(100) 
     if n != 0
     and n % 2 == 0   *#(<-- new condition)*
     and n % 5 == 0]

What happens is that if you hit return at the end of the second line, the 
editor inserts a colon as the last character and opens up a new line with 
an extra indentation. That is, what I get just after hitting return is

a = [n for n in range(100) 
     if n != 0:  *#(<-- note the colon)*
          _ *#(<-- blinking cursor after the extra indentation)*
     and n % 5 == 0]

I have the 'automatic insertion of colons...' option set in my preferences. 
If it is not set, this doesn't happen.

This may look like a contrived example, but it actually happened to me in a 
situation where I already had 3 levels of indentation and the variables all 
had somewhat long names.  Nevertheless, I have noticed it only recently, 
after more a year of heavy spyder use.

I have tested against versions 2.3.0beta4, 2.2.5 and 2.2.1 (this last one 
from Kubuntu 13.10).  Trying to report an issue from withing spyder gives 
the following information:

Spyder Version: 2.3.0beta4
Python Version: 2.7.5+
Qt Version : 4.8.4, PySide 1.1.2 on Linux
IPython >=0.13 : 0.13.2 (OK)
pyflakes >=0.5.0: 0.7.3 (OK)
pep8 >=0.6 : 1.4.6 (OK)
pygments >=1.6 : 1.6 (OK)
sphinx >=0.6.6 : 1.1.3 (OK)
psutil >=0.3 : 0.6.1 (OK)
rope >=0.9.2 : 0.9.2 (OK)
matplotlib >=1.0: 1.2.1 (OK)
sympy >=0.7.0 : None (NOK)
pylint >=0.25 : 0.26.0 (OK)


Is this really a bug?  Should I open an issue?  Thanks for your attention.

Hermano

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to