Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > e870e6598e1c7e3918555a3d0ba5f3d4 > files > 783

python3-docs-3.1.1-2mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>8.10. types — Names for built-in types &mdash; Python v3.1.1 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '3.1.1',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v3.1.1 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v3.1.1 documentation" href="../index.html" />
    <link rel="up" title="8. Data Types" href="datatypes.html" />
    <link rel="next" title="8.11. copy — Shallow and deep copy operations" href="copy.html" />
    <link rel="prev" title="8.9. weakref — Weak references" href="weakref.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="copy.html" title="8.11. copy — Shallow and deep copy operations"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="weakref.html" title="8.9. weakref — Weak references"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v3.1.1 documentation</a> &raquo;</li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="datatypes.html" accesskey="U">8. Data Types</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-types">
<h1>8.10. <tt class="xref docutils literal"><span class="pre">types</span></tt> &#8212; Names for built-in types<a class="headerlink" href="#module-types" title="Permalink to this headline">¶</a></h1>
<p>This module defines names for some object types that are used by the standard
Python interpreter, but not exposed as builtins like <a title="int" class="reference external" href="functions.html#int"><tt class="xref docutils literal"><span class="pre">int</span></tt></a> or
<a title="str" class="reference external" href="functions.html#str"><tt class="xref docutils literal"><span class="pre">str</span></tt></a> are.  Also, it does not include some of the types that arise
transparently during processing such as the <tt class="docutils literal"><span class="pre">listiterator</span></tt> type.</p>
<p>Typical use is for <a title="isinstance" class="reference external" href="functions.html#isinstance"><tt class="xref docutils literal"><span class="pre">isinstance()</span></tt></a> or <a title="issubclass" class="reference external" href="functions.html#issubclass"><tt class="xref docutils literal"><span class="pre">issubclass()</span></tt></a> checks.</p>
<p>The module defines the following names:</p>
<dl class="data">
<dt id="types.FunctionType">
<tt class="descclassname">types.</tt><tt class="descname">FunctionType</tt><a class="headerlink" href="#types.FunctionType" title="Permalink to this definition">¶</a></dt>
<dt id="types.LambdaType">
<tt class="descclassname">types.</tt><tt class="descname">LambdaType</tt><a class="headerlink" href="#types.LambdaType" title="Permalink to this definition">¶</a></dt>
<dd>The type of user-defined functions and functions created by <a class="reference external" href="../reference/expressions.html#lambda"><tt class="xref docutils literal"><span class="pre">lambda</span></tt></a>
expressions.</dd></dl>

<dl class="data">
<dt id="types.GeneratorType">
<tt class="descclassname">types.</tt><tt class="descname">GeneratorType</tt><a class="headerlink" href="#types.GeneratorType" title="Permalink to this definition">¶</a></dt>
<dd>The type of <a class="reference external" href="../glossary.html#term-generator"><em class="xref">generator</em></a>-iterator objects, produced by calling a
generator function.</dd></dl>

<dl class="data">
<dt id="types.CodeType">
<tt class="descclassname">types.</tt><tt class="descname">CodeType</tt><a class="headerlink" href="#types.CodeType" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-611">The type for code objects such as returned by <a title="compile" class="reference external" href="functions.html#compile"><tt class="xref docutils literal"><span class="pre">compile()</span></tt></a>.</p>
</dd></dl>

<dl class="data">
<dt id="types.MethodType">
<tt class="descclassname">types.</tt><tt class="descname">MethodType</tt><a class="headerlink" href="#types.MethodType" title="Permalink to this definition">¶</a></dt>
<dd>The type of methods of user-defined class instances.</dd></dl>

<dl class="data">
<dt id="types.BuiltinFunctionType">
<tt class="descclassname">types.</tt><tt class="descname">BuiltinFunctionType</tt><a class="headerlink" href="#types.BuiltinFunctionType" title="Permalink to this definition">¶</a></dt>
<dt id="types.BuiltinMethodType">
<tt class="descclassname">types.</tt><tt class="descname">BuiltinMethodType</tt><a class="headerlink" href="#types.BuiltinMethodType" title="Permalink to this definition">¶</a></dt>
<dd>The type of built-in functions like <a title="len" class="reference external" href="functions.html#len"><tt class="xref docutils literal"><span class="pre">len()</span></tt></a> or <a title="sys.exit" class="reference external" href="sys.html#sys.exit"><tt class="xref docutils literal"><span class="pre">sys.exit()</span></tt></a>, and
methods of built-in classes.  (Here, the term &#8220;built-in&#8221; means &#8220;written in
C&#8221;.)</dd></dl>

<dl class="data">
<dt id="types.ModuleType">
<tt class="descclassname">types.</tt><tt class="descname">ModuleType</tt><a class="headerlink" href="#types.ModuleType" title="Permalink to this definition">¶</a></dt>
<dd>The type of modules.</dd></dl>

<dl class="data">
<dt id="types.TracebackType">
<tt class="descclassname">types.</tt><tt class="descname">TracebackType</tt><a class="headerlink" href="#types.TracebackType" title="Permalink to this definition">¶</a></dt>
<dd>The type of traceback objects such as found in <tt class="docutils literal"><span class="pre">sys.exc_info()[2]</span></tt>.</dd></dl>

<dl class="data">
<dt id="types.FrameType">
<tt class="descclassname">types.</tt><tt class="descname">FrameType</tt><a class="headerlink" href="#types.FrameType" title="Permalink to this definition">¶</a></dt>
<dd>The type of frame objects such as found in <tt class="docutils literal"><span class="pre">tb.tb_frame</span></tt> if <tt class="docutils literal"><span class="pre">tb</span></tt> is a
traceback object.</dd></dl>

<dl class="data">
<dt id="types.GetSetDescriptorType">
<tt class="descclassname">types.</tt><tt class="descname">GetSetDescriptorType</tt><a class="headerlink" href="#types.GetSetDescriptorType" title="Permalink to this definition">¶</a></dt>
<dd>The type of objects defined in extension modules with <tt class="docutils literal"><span class="pre">PyGetSetDef</span></tt>, such
as <tt class="docutils literal"><span class="pre">FrameType.f_locals</span></tt> or <tt class="docutils literal"><span class="pre">array.array.typecode</span></tt>.  This type is used as
descriptor for object attributes; it has the same purpose as the
<a title="property" class="reference external" href="functions.html#property"><tt class="xref docutils literal"><span class="pre">property</span></tt></a> type, but for classes defined in extension modules.</dd></dl>

<dl class="data">
<dt id="types.MemberDescriptorType">
<tt class="descclassname">types.</tt><tt class="descname">MemberDescriptorType</tt><a class="headerlink" href="#types.MemberDescriptorType" title="Permalink to this definition">¶</a></dt>
<dd>The type of objects defined in extension modules with <tt class="docutils literal"><span class="pre">PyMemberDef</span></tt>, such
as <tt class="docutils literal"><span class="pre">datetime.timedelta.days</span></tt>.  This type is used as descriptor for simple C
data members which use standard conversion functions; it has the same purpose
as the <a title="property" class="reference external" href="functions.html#property"><tt class="xref docutils literal"><span class="pre">property</span></tt></a> type, but for classes defined in extension modules.
In other implementations of Python, this type may be identical to
<tt class="docutils literal"><span class="pre">GetSetDescriptorType</span></tt>.</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h4>Previous topic</h4>
            <p class="topless"><a href="weakref.html"
                                  title="previous chapter">8.9. <tt class="docutils literal docutils literal"><span class="pre">weakref</span></tt> &#8212; Weak references</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="copy.html"
                                  title="next chapter">8.11. <tt class="docutils literal docutils literal docutils literal"><span class="pre">copy</span></tt> &#8212; Shallow and deep copy operations</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/library/types.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="copy.html" title="8.11. copy — Shallow and deep copy operations"
             >next</a> |</li>
        <li class="right" >
          <a href="weakref.html" title="8.9. weakref — Weak references"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v3.1.1 documentation</a> &raquo;</li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="datatypes.html" >8. Data Types</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2009, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.  
    <a href="http://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Aug 16, 2009.
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.2.
    </div>

  </body>
</html>