Adam Johnson
Adam Johnson
@sigmavirus24 `_` is not against the PEP, sorry the full text is: > Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves...
Why? It's dead for nearly 2 years now. For those on Python 2, pip will install the old version, thanks to `python_requires`.
Okay well up to you. You can keep this PR open for when the time comes if you like.
Thanks for the suggestion. In the past I removed some rules that suggested using generators over comprehensions, because the increase in laziness is not always a 100% compatible change: https://github.com/adamchainz/flake8-comprehensions/blob/main/HISTORY.rst#340-2021-03-18...
Indeed it can. I think this will require a bit more code to detect than for the existing rules - we'd have to search for a string object, attribute access,...
Since flake8 doesn't do any typing, we're restricted to builtins here.
Yes Tom, thanks!
Still a tiny bit faster - Python 3.8.2: ``` In [1]: %timeit ",".join([str(i) for i in range(3)]) 1.01 µs ± 37.6 ns per loop (mean ± std. dev. of 7...
`(str(i) for i in range(3))` *is* a genertaor. It just has extra brackets.
I'd be happy to consider concrete proposals where using the walrus would lead to a comprehension/generator expression being faster. Do you have any?