4 ms·
You know a guide is good when it makes you want to go back and refactor old code. Great information, thanks :)
by avolcano 14y ago
You know a guide is good when it makes you want to go back and refactor old code. Great information, thanks :)
- alexpopescu 14y agoInterestingly after reading the post I've realized that while I've been using the more advanced stuff, I was missing the first 2 basic ones.
- DeepDuh 14y agoHappened to me too, I always used 'for key in mydict: do_something(key, mydict[key])' instead of 'for key, value' I guess python leaves so many ways to do things that you tend to settle on some style quickly even if it's not the most efficient one. When self learning new languages I still miss an efficient way to get all the idioms. However I think that in python it's not really that important, as long as you get stuff done - your code is still going to be quite readable.
- RyanMcGreal 14y agoPython doesn't always hew too closely to TSBOAPOOOWTDI, despite Ken Peters' lovely entreaty. http://www.python.org/dev/peps/pep-0020/ http://www.python.org/dev/peps/pep-0020/
- simgidacav 14y agoMy good friend, refactoring is sometimes good, but remember the ancient wisdom: don't fix what's not broken! Your old code may not be pythonic, but still it works...