3 ms·
It's mostly a bikeshed and a signaling thing. Only a "noob" wouldn't know about enumerate(), right? The program could be brilliant in much higher level ways, bu
by futureastronaut 8y ago
It's mostly a bikeshed and a signaling thing. Only a "noob" wouldn't know about enumerate(), right? The program could be brilliant in much higher level ways, but mid/senior only-knows-Python hot shot will jump on your anti-idiom like a dog on a dropped hamburger. Including such anti-idioms in your public code can filter out people like that.
- SilurianWenlock 8y agoWhere are you meant to learn this?
- xkcd-sucks 8y agohttps://docs.python.org/3/ https://docs.python.org/3/ Consider that your iterable may not be a list, and may not actually have a "length" prior to its being consumed
- futureastronaut 8y agoPython's list of built-in functions is fairly small https://docs.python.org/3/library/functions.html#built-in-funcs https://docs.python.org/3/library/functions.html#built-in-fu... (but to be clear, I wouldn't ding somebody for forgetting about one of them).
- progval 8y agoReading other people's code (usually while improving it)