Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / html / python / lib / non-essential-built-in-funcs.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="lib.html" title='Python Library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="types.html" />
<link rel="prev" href="built-in-funcs.html" />
<link rel="parent" href="builtin.html" />
<link rel="next" href="types.html" />
<meta name='aesop' content='information' />
<title>2.2 Non-essential Built-in Functions </title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.1 Built-in Functions"
href="built-in-funcs.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="2. Built-In Objects"
href="builtin.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="2.3 Built-in Types"
href="types.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="built-in-funcs.html">2.1 Built-in Functions</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="builtin.html">2. Built-In Objects</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="types.html">2.3 Built-in Types</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION004200000000000000000"></A><A NAME="non-essential-built-in-funcs"></A>
<BR>
2.2 Non-essential Built-in Functions
</H1>
<P>
There are several built-in functions that are no longer essential to learn,
know or use in modern Python programming. They have been kept here to
maintain backwards compatibility with programs written for older versions
of Python.
<P>
Python programmers, trainers, students and bookwriters should feel free to
bypass these functions without concerns about missing something important.
<P>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-85' xml:id='l2h-85' class="function">apply</tt></b>(</nobr></td>
<td><var>function, args</var><big>[</big><var>, keywords</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
The <var>function</var> argument must be a callable object (a
user-defined or built-in function or method, or a class object) and
the <var>args</var> argument must be a sequence. The <var>function</var> is
called with <var>args</var> as the argument list; the number of arguments
is the length of the tuple.
If the optional <var>keywords</var> argument is present, it must be a
dictionary whose keys are strings. It specifies keyword arguments
to be added to the end of the argument list.
Calling <tt class="function">apply()</tt> is different from just calling
<code><var>function</var>(<var>args</var>)</code>, since in that case there is always
exactly one argument. The use of <tt class="function">apply()</tt> is equivalent
to <code><var>function</var>(*<var>args</var>, **<var>keywords</var>)</code>.
Use of <tt class="function">apply()</tt> is not necessary since the ``extended call
syntax,'' as used in the last example, is completely equivalent.
<P>
<div class="versionnote"><b>Deprecated since release 2.3.</b>
Use the extended call syntax instead, as described
above.</div><p></p>
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-86' xml:id='l2h-86' class="function">buffer</tt></b>(</nobr></td>
<td><var>object</var><big>[</big><var>, offset</var><big>[</big><var>, size</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
The <var>object</var> argument must be an object that supports the buffer
call interface (such as strings, arrays, and buffers). A new buffer
object will be created which references the <var>object</var> argument.
The buffer object will be a slice from the beginning of <var>object</var>
(or from the specified <var>offset</var>). The slice will extend to the
end of <var>object</var> (or will have a length given by the <var>size</var>
argument).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-87' xml:id='l2h-87' class="function">coerce</tt></b>(</nobr></td>
<td><var>x, y</var>)</td></tr></table></dt>
<dd>
Return a tuple consisting of the two numeric arguments converted to
a common type, using the same rules as used by arithmetic
operations. If coercion is not possible, raise <tt class="exception">TypeError</tt>.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-88' xml:id='l2h-88' class="function">intern</tt></b>(</nobr></td>
<td><var>string</var>)</td></tr></table></dt>
<dd>
Enter <var>string</var> in the table of ``interned'' strings and return
the interned string - which is <var>string</var> 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.
<span class="versionnote">Changed in version 2.3:
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 <tt class="function">intern()</tt>
around to benefit from it.</span>
</dl>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.1 Built-in Functions"
href="built-in-funcs.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="2. Built-In Objects"
href="builtin.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="2.3 Built-in Types"
href="types.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="built-in-funcs.html">2.1 Built-in Functions</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="builtin.html">2. Built-In Objects</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="types.html">2.3 Built-in Types</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>