3 ms·
Python core libraries have great code. You can open pretty much any module and be able to understand the source without much context.
by mixedbit 8y ago
Python core libraries have great code. You can open pretty much any module and be able to understand the source without much context.
- falsedan 8y agoThe only core library code I needed to look at was namedtuple, which is pretty incomprehensible even with context.
- xtreak29 8y agoThough core has some bad API due to maintaining backwards compatibility a lot of the third party libraries like requests, Flask have great focus on API design and code quality. The authors have good quality repos : https://github.com/kennethreitz https://github.com/kennethreitz https://github.com/mitsuhiko https://github.com/mitsuhiko
- Walkman 8y agoYou obviously did not dig in :D There are absolutely terrible parts, would not recommend!
- akvadrako 8y agoI don't know how you can say this. The standard lib isn't even very pythonic, let alone "great" along other dimensions.
- blattimwind 8y agoAgreed. Almost every time I've looked deeply into stdlib code I was surprised by how hard to follow it is and how frequently antipatterns are employed. Doubly so for anything near a C module. I consider the Python stdlib in a similar vein as the C++ stdlib or Boost: Yes, some useful bits in there, but (1) lots of rot (2) you don't want to have your code look anything like it.
- dyeray 8y agoAgreed with the rest, I've ended up reading pypy's implementation of some functions sometimes to see how it works after trying CPython first. From the few I've read I'd say pypy looks nice by the way (I'm talking about standard library).