4 ms·
It's not that common. There's 1 place where its useful imo (comprehensions to avoid duplicate calls), but even that can be handled case by case, and it certainl
by joshuamorton 7y ago
It's not that common. There's 1 place where its useful imo (comprehensions to avoid duplicate calls), but even that can be handled case by case, and it certainly isn't a common thing.
- theli0nheart 7y agoDisagree. In my experience (albeit, not very long, been writing Python since 2007 or so), assigning to a value and checking for truthiness is a very common pattern.
- noname120 7y agoVery common pattern, confusing nonetheless. It does two different things at once where traditionally Python is explicit and only does one thing at once.
- nerdponx 7y agoThis is probably the one argument against it that I agree with: I don't actually like it when I see it in other languages!
- coldtea 7y agoIt's extremely common. I've had to use a workaround for that every time I've tested a regular expression match that I wanted to process for example. Also problematic in comprehensions...