3 ms·
All list comprehensions should error with message "FATAL PARSE ERROR: Will you really understand this in six months?"
by polski-g 4y ago
All list comprehensions should error with message "FATAL PARSE ERROR: Will you really understand this in six months?"
- TremendousJudge 4y agoIf people complain about Rust's borrow checker already...
- wheelerof4te 4y agoList comprehensions should be used for making quick lists that contain simple calculations or filters. Anything more will come back to bite you later.
- teekert 4y agoSomething 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.