As promised, here starts the ill-advised series of me reading the #Python Standard Library documentation. First day: Built-In Functions, which I grouped by topic.
My personal highlight was learning about the two-argument version of iter(): https://rixx.de/blog/first-sunday-of-advent-built-in-functions/
November 30: Built-in types (and constants and exceptions). Highlights include my surprise at set operations taking any iterable when you spell them out (my_set.union([1,2,3]) works!)
December 1: Text processing services, with the modules: string, re, difflib, textwrap, unicodedata, stringprep, readline. https://rixx.de/blog/december-1-python-text-processing-services/
Highlights: Some string functions I didn't know about, a reminder that textwrap exists and is good, and difflib.get_close_matches()
December 2: Binary data services, namely struct and codecs. Not a lot this time, but that's only fair, because tomorrow is "data types" 😱
Highlights for today: Yet Another Format String Syntax, and also native support for ROT-13 let's go
December 3: The "data types" section, which was … a lot: datetime, calendar, collections, heapq, bisect, array, weakref, types, copy, pprint, reprlib and enum. https://rixx.de/blog/december-3-python-data-types/
tl;dr: collections remains the best, enums are weird, and I have a decent grip on weakrefs now
With a full 13 minutes to go until midnight! December 4: maths. https://rixx.de/blog/december-4-python-numeric-and-mathematical-modules/
Highlights include shameless tau propaganda, giggling at the reason that cmath exists, fraction.limit_denominator() 😍, and my eyes glazing over at the amount of statistics Python can do.
Proceeding: Python Functional Programming Modules, itertools and functools and operator (yes, the one you only ever use for sorting by a specific key).
Big learning day: I learnt about cached_property and lru_cache and singledispatch.
More than a week in, I'm switching to AoE submission mode 🤣
Today: File access modules, or: oh god, why are there SO MANY. Highlights include some neat shutil functions and also the huge comparison table for the os.path/pathlib overlap.
I published the blog post yesterday, but forgot to post here: Python Data Persistence Modules (aka: pickle and some even weirder stuff). https://rixx.de/blog/december-7-python-data-persistence-modules/
Next: Python data compression modules. Python has a CLI interface for compressing, listing and decompressing zip and tar archives, who knew! https://rixx.de/blog/december-8-pyton-data-compression-and-archiving-modules/
TIL in Python: CSV, JSON and XML all live in different sections of the Python docs. Also, there are dataformats like netrc, xdr and plist. Also, use csv.DictReader/Writer!
And INI files can support variable expansion, what could possibly go wrong. https://rixx.de/blog/december-9-python-file-format-modules/
🤫 secrets! And other cryptographic service modules. Not a lot to say here, really, except that the secrets module exists and should be use for security-critical randomness. https://rixx.de/blog/december-10-python-cryptographic-service-modules/
I'm a day late, because this entry is about "operating system services", and that includes os, io, time, argparse, getopt, logging and its submodules, getpass, curses and submodules, platform, errno and ctypes. Whew. https://rixx.de/blog/december-11-python-operating-system-services/
Back on track thanks to the shortest section in the documentation tree: It's just context variables. It's a bit terse, so instead of my usual summary post, this is me trying to make sense of the whole thing. https://rixx.de/blog/december-12-context-variables/
Mastodon ist ein soziales Netzwerk. Es basiert auf offenen Web-Protokollen und freier, quelloffener Software. Es ist dezentral (so wie E-Mail!).