File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,6 +212,19 @@ \section{Built-in Functions}
212212 the backslash convention.
213213\end {funcdesc }
214214
215+ \begin {funcdesc }{intern}{string}
216+ Enter \var {string} in the table of `` interned'' strings and return
217+ the interned string -- which is \var {string} itself or a copy.
218+ Interning strings is useful to gain a little performance on
219+ dictionary lookup -- if the keys in a dictionary are interned, and
220+ the lookup key is interned, the key comparisons (after hashing) can
221+ be done by a pointer compare instead of a string compare. Normally,
222+ the names used in Python programs are automatically interned, and
223+ the dictionaries used to hold module, class or instance attributes
224+ have interned keys. Interned strings are immortal (i.e. never get
225+ garbage collected).
226+ \end {funcdesc }
227+
215228\begin {funcdesc }{int}{x}
216229 Convert a number to a plain integer. The argument may be a plain or
217230 long integer or a floating point number. Conversion of floating
Original file line number Diff line number Diff line change @@ -212,6 +212,19 @@ \section{Built-in Functions}
212212 the backslash convention.
213213\end {funcdesc }
214214
215+ \begin {funcdesc }{intern}{string}
216+ Enter \var {string} in the table of `` interned'' strings and return
217+ the interned string -- which is \var {string} itself or a copy.
218+ Interning strings is useful to gain a little performance on
219+ dictionary lookup -- if the keys in a dictionary are interned, and
220+ the lookup key is interned, the key comparisons (after hashing) can
221+ be done by a pointer compare instead of a string compare. Normally,
222+ the names used in Python programs are automatically interned, and
223+ the dictionaries used to hold module, class or instance attributes
224+ have interned keys. Interned strings are immortal (i.e. never get
225+ garbage collected).
226+ \end {funcdesc }
227+
215228\begin {funcdesc }{int}{x}
216229 Convert a number to a plain integer. The argument may be a plain or
217230 long integer or a floating point number. Conversion of floating
You can’t perform that action at this time.
0 commit comments