A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-July/026320.html below:

[Python-Dev] Alternative implementation of interning, take 2

[Python-Dev] Alternative implementation of interning, take 2 [Python-Dev] Alternative implementation of interning, take 2Guido van Rossum guido@python.org
Fri, 12 Jul 2002 08:52:01 -0400
> 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