Learn by reading code: Python standard library design decisions explained (for advanced beginners)

submited by
Style Pass
2021-06-29 14:00:02

You've now moving past tutorials and blog posts; maybe you feel they offer one-dimensional solutions to simple, made-up problems; maybe instead of solving this specific problem, you want to get better at solving problems in general.

What if you don't like the right thing? Or worse, what if you like the wrong thing, and get stuck with bad habits because of it?

And even if you knew where to start, how they did it isn't always obvious. Yes, the code is right there, but it doesn't really tell you why they did it, what they didn't do, nor how they thought about the whole thing.

In other words, it is not obvious from the code itself what the design philosophy was, and what choices were considered before settling on an implementation.

On the other hand, at least part of them have detailed proposals explaining the design goals and tradeoffs, and the newer ones are actually quite consistent.

Style aside, there's a lot to learn from the standard library, since it solves real problems for a diverse population of developers.

Leave a Comment