0. Introduction: Traversing the Python Standard Library Documentation
I like Python.
I've been a professional programmer for at least five years now, depending on how you count, and I've spent a majority of that time with Python. I like it. It's comfortable, it's fun, it doesn't get in my way too much most of the time, it has a rich ecosystem filled with good people who make work pleasant, and many of who have turned into friends over the years.
And yet … I have also never gotten over a slightly imposter-syndrome tinged sense of unease around the language. Sure, I've been using it for close to a decade, and sure, I've been putting in time and effort to learn new things and avoid bad patterns. When called upon to relay my experience level, I call myself fluent or experienced or proficient. And yet …
This sense of impending doom is much stronger when I work with other languages and frameworks, particularly frontend frameworks. It's all about knowledge depth and stack height. The more I know about my tools and my language, the more comfortable I am. The more confident I am in a deep understanding, the less looming catastrophes in the back of my mind. And while I have a good understanding of the parts of Python that I have encountered, I have no way of knowing what I have not encountered yet.
Once I understood that ("That's all?!"), I headed over to the Python Standard Library documentation. It's extensive. The Python Standard Library is huge (which is arguably Python's biggest strength or a serious weakness), and not a week goes by without me finding something new in it, either by way of other people's code, or via social media. This state of learning has grown from a nice introduction to a helpful and expected resource to a serious annoyance.
And so, while staring at the long table of contents, and counting its sections
(document.querySelectorAll(".toctree-wrapper > ul > li").length), of which there are 38, I decided in a snap decision
that I will come to regret: I'm going to read this. All¹ of it. And since we just hit the beginning of advent, I might
as well publish my notes as the most useless studying advent calendar: Why not?
My goal is not to memorise everything in there, or even to add a ton of things to my everyday Python vocabulary. My goal is to have seen it all, and increase the chances of triggering vague "wait, I think I can use the standard library for that" memories. I'm not sure my notes will be of any use to anybody else, but I'm told the Internet does not currently have a storage problem, so I'll just publish them on the off chance.
I'm not quite sure how I'll structure my notes yet: I'll probably sum up the documentation pages, and then add bullet notes of interfaces that I found interesting or worth remembering, or something like that. With luck, I'll put my findings into an Anki deck, and I can share that too if there's any interest.
List of posts
- First Sunday of Advent: Built-in Functions
-
November 30: More built-ins
- Constants
- Types
- Exceptions
-
December 1: Python Text Processing Services
stringredifflibtextwrapunicodedatastringprepreadline
-
December 2: Python Binary Data Services
structcodecs
-
December 3: Python Data Types
datetimecalendarcollectionsheapqbisectarrayweakreftypescopypprintreprlibenum
-
December 4: Python Numeric and Mathematical Modules
numbersmathcmathdecimalfractionsrandomstatistics
-
December 5: Python Functional Programming Modules
itertoolsfunctoolsoperator
-
December 6: Python File and Directory Access
pathlibos.pathfileinputstatfilecmptempfileglobfnmatchlinecacheshutil
-
December 7: Python Data Persistence Modules
picklecopyregshelvemarshaldbmsqlite3
-
December 8: Python Data Compression and Archiving
Modules
zlibgzipbz2lzmazipfiletarfile
-
December 9: Python File Format Modules
csvconfigparsernetrcxdrlibplistlib
-
December 10: Python Cryptographic Service Modules
hashlibhmacsecrets
-
December 11: Python Operating System Service Modules
osiotimeargparsegetoptlogginggetpasscursesplatformerrnoctypes
- December 12: Context Variables
-
December 13: Python Concurrent Execution Modules
threadingmultiprocessingconcurrentsubprocessschedqueue
¹ Minus things that really really really don't interest me, like tkinter or custom interpreters or the OS specific
services.