May-01-2017, 04:06 PM
(May-01-2017, 02:01 PM)nilamo Wrote: The original example could also be written like this, though I think using backslashes looks worse than the dangling parentheses...Actually - while I hate backlashes - I would rather use this option - it's ugly but it's more obvious
things = query(range(1000)) \ .where(lambda x: x % 2 == 0) \ .where(lambda x: x % 3 == 0) \ .where(lambda x: x % 4 == 0) \ .where(lambda x: x % 5 == 0)
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.