I have been programming Python for a while and I have a very good understanding of its features, but I would like to improve my coding style. I think reading the source code of the Python Modules would be a good idea. Can anyone recommend any ones in particular?
Related Threads:
Queue.py shows you how to make a class thread-safe, and the proper use of the Template Method design pattern.
sched.py is a great example of the Dependency Injection pattern.
heapq.py is a really well-crafted implementation of the Heap data structure.
If I had to pick my three favorite modules in the Python standard library, this triplet would probably be my choice. (It doesn't hurt that they're all so very useful... but I'm picking in terms of quality of code, comments and design, first and foremost).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With