From 66a796e5ab8dd7bfc1fe05a830feb05acdab6f53 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 19 Dec 2006 20:50:34 +0000 Subject: Patch #1601678: move intern() to sys.intern(). --- Doc/lib/libfuncs.tex | 14 -------------- Doc/lib/libsys.tex | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'Doc/lib') diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index a8c06bb18c..7e0b88d095 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -1262,17 +1262,3 @@ bypass these functions without concerns about missing something important. argument). \end{funcdesc} -\begin{funcdesc}{intern}{string} - Enter \var{string} in the table of ``interned'' strings and return - the interned string -- which is \var{string} itself or a copy. - Interning strings is useful to gain a little performance on - dictionary lookup -- if the keys in a dictionary are interned, and - the lookup key is interned, the key comparisons (after hashing) can - be done by a pointer compare instead of a string compare. Normally, - the names used in Python programs are automatically interned, and - the dictionaries used to hold module, class or instance attributes - have interned keys. \versionchanged[Interned strings are not - immortal (like they used to be in Python 2.2 and before); - you must keep a reference to the return value of \function{intern()} - around to benefit from it]{2.3} -\end{funcdesc} diff --git a/Doc/lib/libsys.tex b/Doc/lib/libsys.tex index 702427a257..7a8859bfb4 100644 --- a/Doc/lib/libsys.tex +++ b/Doc/lib/libsys.tex @@ -340,6 +340,21 @@ else: \versionadded{1.5.2} \end{datadesc} +\begin{funcdesc}{intern}{string} + Enter \var{string} in the table of ``interned'' strings and return + the interned string -- which is \var{string} itself or a copy. + Interning strings is useful to gain a little performance on + dictionary lookup -- if the keys in a dictionary are interned, and + the lookup key is interned, the key comparisons (after hashing) can + be done by a pointer compare instead of a string compare. Normally, + the names used in Python programs are automatically interned, and + the dictionaries used to hold module, class or instance attributes + have interned keys. \versionchanged[Interned strings are not + immortal (like they used to be in Python 2.2 and before); + you must keep a reference to the return value of \function{intern()} + around to benefit from it]{2.3} +\end{funcdesc} + \begin{datadesc}{last_type} \dataline{last_value} \dataline{last_traceback} -- cgit v1.2.1