question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The editor adds ":" when type in multiply lines list comprehension

See original GitHub issue

From ruoyu0…@gmail.com on 2013-04-14T21:39:40Z

Spyder Version: 2.2.0rc Python Version: 2.7.3 Qt Version: 4.8.3, PyQt4 (API v2) 4.9.5 on Windows

What steps will reproduce the problem?

Type in multiply lines list comprehension such as:

[some_very_long_expression(x)
    for x in range(n)
    if n % 2 == 0]

What is the expected output? What do you see instead?

“:” will be appended to the “for” & “if” lines.

_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1354_

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
hengincommented, Dec 5, 2020

Hi @dalthviz. Sure, I just need to figure out the details first so I can actually implement something. I might not have time to do so today, though. Maybe tomorrow or next weekend.

0reactions
dalthvizcommented, Dec 5, 2020

Awesome and no problem 👍 Thanks again for the help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Line continuation for list comprehensions or generator ...
However, when the list comprehension needs to be split over multiple lines, that conciseness can make the expression extremely difficult to read.
Read more >
Python List Comprehension: single, multiple, nested, & more
A list comprehension works by translating values from one list into another by placing a for statement inside a pair of brackets, formally...
Read more >
Overusing list comprehensions and generator expressions in ...
In general, I prefer to write most of my comprehensions spaced out over multiple lines of code using the indentation style above.
Read more >
Understanding List Comprehensions in Python 3 - DigitalOcean
Our list comprehension takes the nested for loops and flattens them into one line of code while still creating the exact same list...
Read more >
List Comprehensions in Python - Stack Abuse
List Comprehensions is the process of creating a new list from an existing one. They offer many benefits to traditional lists.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found