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.

WPS111 too strict inside comprehensions

See original GitHub issue

Bug report

I think that WPS111 is too restrictive with vars that are only used in comprehension-like expressions.

What’s wrong

It says that s is too short here:

[s.encode() for s in cythonize_args]

How is that should be

it doesn’t make sense for throwaway vars in list/dict/set comprehensions or generator expressions to be long.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
sobolevncommented, Feb 6, 2021

I am going to decline this feature. I really don’t like short variable names. Sorry 😓

1reaction
orsiniumcommented, Aug 20, 2020

Related:

Short variable names work well when the distance between their declaration and last use is short.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overusing list comprehensions and generator expressions in ...
Practice Python list comprehensions right now! Writing comprehensions with poor spacing. Critics of list comprehensions often say they're hard ...
Read more >
5 Wrong Use Cases Of Python List Comprehensions
In either of the cases, picking list comprehensions just because it's fancy doesn't mean it's pythonic too. Let's consider the following example ...
Read more >
How complex is too complex for a list comprehension? [closed]
List comprehensions are a very powerful tool in Python, but sometimes I find myself putting an awful lot of stuff inside of them....
Read more >
When to Use a List Comprehension in Python
In this tutorial, you'll learn when to use a list comprehension in Python and how ... Some programmers even use them too much,...
Read more >
Python List Comprehensions Are More Powerful Than You ...
In this example we build a generator inside list comprehension which is consumed by the outer loop. If you find this hard to...
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