2 ms·
I use Python's comprehensions a lot (list, tuple/generator, set and dict). I would not ding someone for not using them. They're a tool, but not always the right
by hermitdev 7y ago
I use Python's comprehensions a lot (list, tuple/generator, set and dict). I would not ding someone for not using them. They're a tool, but not always the right tool.
Also, complex comprehensions can get out of hand and explicit loops become more legible.
I got dinged at a trading shop using C# for using Linq instead of hand-writing the loops. I wasnt given any constraints, just solve X problems. I also wasnt being paid for the test, so I solved the problems in the most expedient manner for me. I didnt get the job. So it goes...
Edit: I would ding someone claiming to be an experienced Python dev that cant identify/understand a comprehension. I've 16 years of experience with Python, so I know a fair amount (though the Python documentation is eternally open in my browser). I'm also the only person on my team with any real Python experience. We're building out extensive infrastructure in Python, so Ive been doing a lot of patient mentoring.
- loopz 7y agoSo it's about you.