Deep Dive into Python’s dict type
Let’s continue analysis from Performance Analysis of Python’s dict() and {} and dive deeper into
the Python’s internal types for dict.
dict typeLet’s continue analysis from Performance Analysis of Python’s dict() and {} and dive deeper into
the Python’s internal types for dict.
During my 12–year journey through formal education I became very familiar with 6–point grading scale. It’s one of those things you are exposed to so early in life, that you accept it as a truth about the world. And for me, empirically, it made sense. I could always say if something was excellent, very good, good, acceptable, bad, or tragic.
Have you ever wondered how to protect your master password from getting lost? Or how to create a perfect democracy where nuke access is shared between most important people in the government equally? Or how to achieve immortality by splitting your soul and putting the pieces into objects? 🪄
If so, then you’ve come to the right place. Join me, my friend, on this discovery of Shamir’s secret sharing.
dict() and {}Some time ago, during a code review, I had a discussion with a colleague of mine about preferring dict() over {} in
new Python code. They argued that dict() is more readable — and expresses intent more clearly — therefore should
be preferred. I wasn’t convinced by that, but at that time I didn’t have any counterarguments, so I passed.
Yet that made me wonder: what’s the difference between the dict type and {} literal expression?
This blog is hosted on GitHub Pages. The service offers free static website hosting (TLS included!). The way it works is that GitHub issues a dedicated subdomain for each hosted website; for this one it’s: nathiss.github.io. However, if you try to access it you’ll be redirected to madebyme.today instead.