Sophie

Sophie

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

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>3. Built-in Constants &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="The Python Standard Library" href="index.html" />
    <link rel="next" title="4. Built-in Objects" href="objects.html" />
    <link rel="prev" title="2. Built-in Functions" href="functions.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="objects.html" title="4. Built-in Objects"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="functions.html" title="2. Built-in Functions"
             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" accesskey="U">The Python Standard Library</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="built-in-constants">
<h1>3. Built-in Constants<a class="headerlink" href="#built-in-constants" title="Permalink to this headline">¶</a></h1>
<p>A small number of constants live in the built-in namespace.  They are:</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><a title="None" class="reference internal" href="#None"><tt class="xref xref docutils literal"><span class="pre">None</span></tt></a>, <a title="False" class="reference internal" href="#False"><tt class="xref xref docutils literal"><span class="pre">False</span></tt></a>, <a title="True" class="reference internal" href="#True"><tt class="xref xref docutils literal"><span class="pre">True</span></tt></a> and <a title="__debug__" class="reference internal" href="#__debug__"><tt class="xref docutils literal"><span class="pre">__debug__</span></tt></a> cannot be
reassigned (assignments to them raise <a title="exceptions.SyntaxError" class="reference external" href="exceptions.html#exceptions.SyntaxError"><tt class="xref docutils literal"><span class="pre">SyntaxError</span></tt></a>), so they can be
considered &#8220;true&#8221; constants.</p>
</div>
<dl class="data">
<dt id="False">
<tt class="descname">False</tt><a class="headerlink" href="#False" title="Permalink to this definition">¶</a></dt>
<dd>The false value of the <a title="bool" class="reference external" href="functions.html#bool"><tt class="xref docutils literal"><span class="pre">bool</span></tt></a> type. Assignments to <tt class="xref docutils literal"><span class="pre">False</span></tt>
are illegal and raise a <a title="exceptions.SyntaxError" class="reference external" href="exceptions.html#exceptions.SyntaxError"><tt class="xref docutils literal"><span class="pre">SyntaxError</span></tt></a>.</dd></dl>

<dl class="data">
<dt id="True">
<tt class="descname">True</tt><a class="headerlink" href="#True" title="Permalink to this definition">¶</a></dt>
<dd>The true value of the <a title="bool" class="reference external" href="functions.html#bool"><tt class="xref docutils literal"><span class="pre">bool</span></tt></a> type. Assignments to <tt class="xref docutils literal"><span class="pre">True</span></tt>
are illegal and raise a <a title="exceptions.SyntaxError" class="reference external" href="exceptions.html#exceptions.SyntaxError"><tt class="xref docutils literal"><span class="pre">SyntaxError</span></tt></a>.</dd></dl>

<dl class="data">
<dt id="None">
<tt class="descname">None</tt><a class="headerlink" href="#None" title="Permalink to this definition">¶</a></dt>
<dd>The sole value of <tt class="xref docutils literal"><span class="pre">types.NoneType</span></tt>.  <tt class="xref docutils literal"><span class="pre">None</span></tt> is frequently used to
represent the absence of a value, as when default arguments are not passed to a
function. Assignments to <tt class="xref docutils literal"><span class="pre">None</span></tt> are illegal and raise a <a title="exceptions.SyntaxError" class="reference external" href="exceptions.html#exceptions.SyntaxError"><tt class="xref docutils literal"><span class="pre">SyntaxError</span></tt></a>.</dd></dl>

<dl class="data">
<dt id="NotImplemented">
<tt class="descname">NotImplemented</tt><a class="headerlink" href="#NotImplemented" title="Permalink to this definition">¶</a></dt>
<dd>Special value which can be returned by the &#8220;rich comparison&#8221; special methods
(<a title="object.__eq__" class="reference external" href="../reference/datamodel.html#object.__eq__"><tt class="xref docutils literal"><span class="pre">__eq__()</span></tt></a>, <a title="object.__lt__" class="reference external" href="../reference/datamodel.html#object.__lt__"><tt class="xref docutils literal"><span class="pre">__lt__()</span></tt></a>, and friends), to indicate that the comparison
is not implemented with respect to the other type.</dd></dl>

<dl class="data">
<dt id="Ellipsis">
<tt class="descname">Ellipsis</tt><a class="headerlink" href="#Ellipsis" title="Permalink to this definition">¶</a></dt>
<dd><p>The same as <tt class="docutils literal"><span class="pre">...</span></tt>. Special value used mostly in conjunction with extended
slicing syntax for user-defined container data types, as in</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="o">..</span> <span class="n">XXX</span> <span class="n">Someone</span> <span class="n">who</span> <span class="n">understands</span> <span class="n">extended</span> <span class="n">slicing</span> <span class="n">should</span> <span class="n">fill</span> <span class="ow">in</span> <span class="n">here</span><span class="o">.</span>
</pre></div>
</div>
</dd></dl>

<dl class="data">
<dt id="__debug__">
<tt class="descname">__debug__</tt><a class="headerlink" href="#__debug__" title="Permalink to this definition">¶</a></dt>
<dd>This constant is true if Python was not started with an <a class="reference external" href="../using/cmdline.html#cmdoption-O"><em class="xref">-O</em></a> option.
Assignments to <a title="__debug__" class="reference internal" href="#__debug__"><tt class="xref docutils literal"><span class="pre">__debug__</span></tt></a> are illegal and raise a <a title="exceptions.SyntaxError" class="reference external" href="exceptions.html#exceptions.SyntaxError"><tt class="xref docutils literal"><span class="pre">SyntaxError</span></tt></a>.
See also the <a class="reference external" href="../reference/simple_stmts.html#assert"><tt class="xref docutils literal"><span class="pre">assert</span></tt></a> statement.</dd></dl>

<div class="section" id="constants-added-by-the-site-module">
<h2>3.1. Constants added by the <a title="A standard way to reference site-specific modules." class="reference external" href="site.html#module-site"><tt class="xref docutils literal"><span class="pre">site</span></tt></a> module<a class="headerlink" href="#constants-added-by-the-site-module" title="Permalink to this headline">¶</a></h2>
<p>The <a title="A standard way to reference site-specific modules." class="reference external" href="site.html#module-site"><tt class="xref docutils literal"><span class="pre">site</span></tt></a> module (which is imported automatically during startup, except
if the <a class="reference external" href="../using/cmdline.html#cmdoption-S"><em class="xref">-S</em></a> command-line option is given) adds several constants to the
built-in namespace.  They are useful for the interactive interpreter shell and
should not be used in programs.</p>
<dl class="data">
<dt id="quit">
<tt class="descname">quit</tt><big>(</big><em>code=None</em><big>)</big><a class="headerlink" href="#quit" title="Permalink to this definition">¶</a></dt>
<dt id="exit">
<tt class="descname">exit</tt><big>(</big><em>code=None</em><big>)</big><a class="headerlink" href="#exit" title="Permalink to this definition">¶</a></dt>
<dd>Objects that when printed, print a message like &#8220;Use quit() or Ctrl-D
(i.e. EOF) to exit&#8221;, and when called, raise <a title="exceptions.SystemExit" class="reference external" href="exceptions.html#exceptions.SystemExit"><tt class="xref docutils literal"><span class="pre">SystemExit</span></tt></a> with the
specified exit code, and when .</dd></dl>

<dl class="data">
<dt id="copyright">
<tt class="descname">copyright</tt><a class="headerlink" href="#copyright" title="Permalink to this definition">¶</a></dt>
<dt id="license">
<tt class="descname">license</tt><a class="headerlink" href="#license" title="Permalink to this definition">¶</a></dt>
<dt id="credits">
<tt class="descname">credits</tt><a class="headerlink" href="#credits" title="Permalink to this definition">¶</a></dt>
<dd>Objects that when printed, print a message like &#8220;Type license() to see the
full license text&#8221;, and when called, display the corresponding text in a
pager-like fashion (one screen at a time).</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../contents.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="">3. Built-in Constants</a><ul>
<li><a class="reference external" href="#constants-added-by-the-site-module">3.1. Constants added by the <tt class="docutils literal"><span class="pre">site</span></tt> module</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="functions.html"
                                  title="previous chapter">2. Built-in Functions</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="objects.html"
                                  title="next chapter">4. Built-in Objects</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/library/constants.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="objects.html" title="4. Built-in Objects"
             >next</a> |</li>
        <li class="right" >
          <a href="functions.html" title="2. Built-in Functions"
             >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> 
      </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>