Re:Python 3.11 vs 3.10 performance
by polski-g on Wednesday July 06, 2022 @01:27PM
(#32004088)
All list comprehensions should error with message "FATAL PARSE ERROR: Will you really understand this in six months?"
[ Parent
| on HN ]
Something like this I find ok (just a filter):
[x for x in y if x is not z]
Sometimes though, facilitated by Jupyter's notebooks making executing as you build the code very easy, I create a beast like this: [os.path.join([x for x in y if x is not z]) + '/bin' for a in b if 'temp' not in a]
Yes this is fictional and probably contains an error but you get the point, you can filter lists of lists like this, but it's really unfriendly to anyone trying to understand it later.
Re:Python 3.11 vs 3.10 performance
by wheelerof4te on Wednesday July 06, 2022 @03:11PM
(#32005422)
List comprehensions should be used for making quick lists that contain simple calculations or filters.
Anything more will come back to bite you later.
Re:Python 3.11 vs 3.10 performance
by TremendousJudge on Wednesday July 06, 2022 @01:42PM
(#32004290)
If people complain about Rust's borrow checker already...