4 ms·
As we move toward languages with big standard libraries, productivity becomes more and more about knowing what you don't have to do yourself. Case in point - e
by etrain 14y ago
As we move toward languages with big standard libraries, productivity becomes more and more about knowing what you don't have to do yourself.
Case in point - even as a Python veteran, I've never seen/used collections.Counter before. It'll save me from writing the same stupid three lines over and over, and is probably implemented faster than I naively do. I'd say that this will improve my productivity.
- darkarmani 14y agoThe biggest problem is having to use old LTS distros in production that only have python 2.6 for example. I'm glad that most LTS versions are soon to be using python 2.7. I know 2.7 has been around for a long time, but so much production software is running on RHEL/Centos systems with 2.6.
- moreati 14y agoTo make you feel a bit better - some of us are still on RHEL 5 and Python 2.4. Yes it is painful.
- cyann 14y agoYou can find python26 in EPEL [1] or follow this guide [2] to setup 2.7. This will install 2.6 or 2.7 in parallel, do not set these by default as it will break yum. [1] https://fedoraproject.org/wiki/Python26 https://fedoraproject.org/wiki/Python26 [2] http://villaroad.com/2010/10/rolling-python-2-6-2-on-centos-5-3/ http://villaroad.com/2010/10/rolling-python-2-6-2-on-centos-...
- conesus 14y agoCould not agree with you more. The more advanced I become with a language, the more I like to go back to even basic docs and read the small-print fancy uses for built-ins. This article touches on a number of them, and it's tricks like this that help you write better code (when used responsibly, of course).
- d0mine 14y agoUsually collections.defaultdict is faster than collections.Counter. But the latter is more concise to use.