zvyn.eu is a user on chaos.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Friendly reminder that NamedTuple is a cool thing in Python

zvyn.eu @zvyn

It is! However there are cases where the initialising overhead hurts (every new namedtuple() is roughly as expensive as an import, perfectly fine on the module scope, deadly in a loop).