News for hackers. Stuff that matters.
Re:In Python, `[0xfor x in (1, 2, 3)]` returns `[15]` by CameronNemo on Tuesday April 13, 2021 @04:16PM (#26798599)
Any way to lint this pattern away? Say what you will about the language and lexer complexity, backwards compatibility. This is a code smell if I have ever seen one.
Re:In Python, `[0xfor x in (1, 2, 3)]` returns `[15]` by tsbinz on Tuesday April 13, 2021 @05:21PM (#26799487)
Enforce consistent formatting, e.g. with black (https://github.com/psf/black) this gets formatted to [0xF or x in (1, 2, 3)].
Re:In Python, `[0xfor x in (1, 2, 3)]` returns `[15]` by mywittyname on Tuesday April 13, 2021 @05:56PM (#26799865)
This issue is caught by a linter and reports, "PEP 8: E225 missing whitespace around operator".
Re:In Python, `[0xfor x in (1, 2, 3)]` returns `[15]` by sco1 on Tuesday April 13, 2021 @06:24PM (#26800180)
Some cases are, but there are still plenty of patterns that (currently) are not. e.g. `1if 1else 2`

See also: https://github.com/PyCQA/pycodestyle/issues/371