CPython String Interning
While reading through CPython code for the last post, I came across string interning and how it’s used as a method of optimisation. What is string interning? String interning is a CPython optimisation that enables python to reuse immutable string objects instead of creating new ones. Much like the interned integers I wrote about in the last post, interened strings can be compared using pointer checks instead of an actual string comparision. ...