Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python core libraries have great code. You can open pretty much any module and be able to understand the source without much context.


I don't know how you can say this. The standard lib isn't even very pythonic, let alone "great" along other dimensions.


Agreed. 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.


The only core library code I needed to look at was namedtuple, which is pretty incomprehensible even with context.


You obviously did not dig in :D There are absolutely terrible parts, would not recommend!


Though 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/mitsuhiko


I agree with Flask, much more readable code than Django for example. I would also add Django Rest Framework (and Tom Christie) to the list.


I think that django-rest-framwork is one of the best software implementations out there!


Agreed 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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: