String Interning in Python: A Hidden Gem That Makes Your Code Faster
Level up the speed of string comparisons
The string interning is a very helpful mechanism in Python to make string comparisons much faster. Unfortunately, how it works and how to use it properly are not very intuitive for beginners. If we don’t understand it, sometimes we could be confused about some unexpected results.