Tagged articles
4 articles
Page 1 of 1
Python Programming Learning Circle
Python Programming Learning Circle
Sep 1, 2025 · Fundamentals

Why Python Dictionary Keys Overwrite Each Other: Hashing, Equality & Identity

This article explores three Python quirks: how dictionary keys with equal numeric values overwrite each other due to hashing and equality rules, why a return statement inside a try block is superseded by a return in the finally clause, and how object identity and id values behave, including hash collisions and memory reuse.

Exception HandlingHashingPython
0 likes · 4 min read
Why Python Dictionary Keys Overwrite Each Other: Hashing, Equality & Identity
Raymond Ops
Raymond Ops
Apr 25, 2025 · Fundamentals

Understanding Python’s `is` Operator, re.sub quirks, and list pitfalls

This article explains why Python’s `is` operator yields True or False for integers, how integer caching and code‑block scope affect object identity, uncovers a subtle misuse of re.sub’s count parameter, clarifies lstrip’s character‑wise stripping, and demonstrates the pitfalls of creating nested lists with the `[*] * n` syntax.

PythonString Manipulationlist-issues
0 likes · 7 min read
Understanding Python’s `is` Operator, re.sub quirks, and list pitfalls