Arpit Bhayani, a software engineer, writes explainers on LLMs, databases, Python internals, and distributed systems topics.
Commenters link his posts for explaining database ACID properties' implementation, Python constant folding, and C struct composition.
>presumably Python has a similar "cache" of such constant strings.
Not really. You're hitting constant folding: https://arpitbhayani.me/blogs/constant-folding-python
This isn't a pre-made list of certain strings that should be cached, this is the compiler noticing that you mentioned the same constant a bunch of times.
Also in general you would see a lot of things with the same id because python uses references all over the place. E.g. assignment never copies.
This blog post series explores ACID properties in databases and touches upon the implementation side which is not usually covered anywhere.
Other posts in the series:
https://arpitbhayani.me/blogs/consistency/
https://arpitbhayani.me/blogs/isolation/
https://arpitbhayani.me/blogs/durability/ - Shortly explains how databases achieve durability
A simpler ECS pattern in plain C
https://www.gamedev.net/articles/programming/general-and-gameplay-programming/implementing-component-entity-systems-r3382/
See post on C struct composition: https://arpitbhayani.me/blogs/inheritance-c
https://arpitbhayani.me
66% of users are expected to like your site :D