The snake sheds its skin.

It has been a fair long while since I was a snake charmer on a daily basis. So, anything with Python does pique my interest even more these days.

Python3.9 release last Monday was a lull one given other stuff on the plate, but there were some bright stars. Here are few that are favourites and lukewarm contenders from the ones I've looked up.

dictionary merge/update

I've used splat for long and don't see it all that odd, so the newer merge/update over a bitwise OR is syntactic sugar. No, nothing wrong here with the syntax or usage issues either, but why fix something that isn't broken?

remove prefix/suffix

Now this is a dandy one, no doubts. But how often does the module that one works with such code not have regex lying around? Regex is one other way of handling this better I'd say. Or with every situation?

abspath in file

On to favourites on a roll, this one must be a lifesaver. I've lost count of the times I had to play around with getcwd, realpath, and handful of calls with each module. Granted, some of it gets fixed by pathlib and that it provides an API to work with paths, always felt a bit off. This might ease some parts of the codebase, sure.

sys.stderr as a consistent linebuffer

Niche for the most part, the fact that sys.stderr uses a linebuffer everywhere is super helpful. For an obscure example, some of Crisp's pipelines used the stderr for reporting. Earlier, any action would be possible only when a block buffer gets filled be consumable. Now, this makes it easier to listen on stderr and catch right when things shoot a threshold/such. Loveable sure.

generic type annotations

Python 3.5+'s annotations are only useful till the point of development to be fair. The perils of a dynamic system are a certain woe in some situations, no doubt. But, a longstanding concern is the fact that even for basic types, annotation came from a types module. Having to use a different List class to the list builtin isn't exactly a "cognitive overload", but why do? Python 3.9 does get rid of this need by allowing type annotation with builtin types themselves. Good way to go there, for maintenance.


Yet another case here, like abspath. While tzinfo is a super useful library, it being external is always adding more cooks to the broth. One of the practical cases was when we used to parse RSS feeds for entry timestamps and having to depend on tzinfo. While I have not replaced it with tzinfo this would be minor win, on paper.

And, there's pidfd_open/others explore. One other nicety is the adoption of a yearly release cycle; this should get interesting as we move ahead.

Full release note.