> What I do need and rely on is the fact that the > Python compiler interns all constant strings and identifiers in > Python programs. This makes switching like so: > > if a == 'x': > elif a == 'y': > else: > > also work like this (only faster): > > if a is 'x': > elif a is 'y': > else: > > provided that 'a' only uses interned strings. Yuck. This is an implementation detail. While it's unlikely to go away in Python 2.0, please don't rely on this in portable Python. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4