Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > e1011ddec34cda34f3a002b121247943 > files > 733

python-docs-2.7.17-1.1.mga7.noarch.rpm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>8. Data Types &#8212; Python 2.7.17 documentation</title>
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 2.7.17 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="next" title="8.1. datetime — Basic date and time types" href="datetime.html" />
    <link rel="prev" title="7.11. fpformat — Floating point conversions" href="fpformat.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    <link rel="canonical" href="https://docs.python.org/2/library/datatypes.html" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    
 
    

  </head><body>  
    <div class="related" role="navigation" aria-label="related navigation">
      <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="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="datetime.html" title="8.1. datetime — Basic date and time types"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="fpformat.html" title="7.11. fpformat — Floating point conversions"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.17 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> &#187;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="data-types">
<span id="datatypes"></span><h1>8. Data Types<a class="headerlink" href="#data-types" title="Permalink to this headline">¶</a></h1>
<p>The modules described in this chapter provide a variety of specialized data
types such as dates and times, fixed-type arrays, heap queues, synchronized
queues, and sets.</p>
<p>Python also provides some built-in data types, in particular,
<a class="reference internal" href="stdtypes.html#dict" title="dict"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code>, <a class="reference internal" href="stdtypes.html#set" title="set"><code class="xref py py-class docutils literal notranslate"><span class="pre">set</span></code></a> (which along with
<a class="reference internal" href="stdtypes.html#frozenset" title="frozenset"><code class="xref py py-class docutils literal notranslate"><span class="pre">frozenset</span></code></a>, replaces the deprecated <a class="reference internal" href="sets.html#module-sets" title="sets: Implementation of sets of unique elements. (deprecated)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sets</span></code></a> module), and
<a class="reference internal" href="functions.html#tuple" title="tuple"><code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code></a>. The <a class="reference internal" href="functions.html#str" title="str"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a> class can be used to handle binary data
and 8-bit text, and the <a class="reference internal" href="functions.html#unicode" title="unicode"><code class="xref py py-class docutils literal notranslate"><span class="pre">unicode</span></code></a> class to handle Unicode text.</p>
<p>The following modules are documented in this chapter:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="datetime.html">8.1. <code class="xref py py-mod docutils literal notranslate"><span class="pre">datetime</span></code> — Basic date and time types</a><ul>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#available-types">8.1.1. Available Types</a></li>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#timedelta-objects">8.1.2. <code class="xref py py-class docutils literal notranslate"><span class="pre">timedelta</span></code> Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#date-objects">8.1.3. <code class="xref py py-class docutils literal notranslate"><span class="pre">date</span></code> Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#datetime-objects">8.1.4. <code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code> Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#time-objects">8.1.5. <code class="xref py py-class docutils literal notranslate"><span class="pre">time</span></code> Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#tzinfo-objects">8.1.6. <code class="xref py py-class docutils literal notranslate"><span class="pre">tzinfo</span></code> Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="datetime.html#strftime-and-strptime-behavior">8.1.7. <code class="xref py py-meth docutils literal notranslate"><span class="pre">strftime()</span></code> and <code class="xref py py-meth docutils literal notranslate"><span class="pre">strptime()</span></code> Behavior</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="calendar.html">8.2. <code class="xref py py-mod docutils literal notranslate"><span class="pre">calendar</span></code> — General calendar-related functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="collections.html">8.3. <code class="xref py py-mod docutils literal notranslate"><span class="pre">collections</span></code> — High-performance container datatypes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="collections.html#counter-objects">8.3.1. <code class="xref py py-class docutils literal notranslate"><span class="pre">Counter</span></code> objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="collections.html#deque-objects">8.3.2. <code class="xref py py-class docutils literal notranslate"><span class="pre">deque</span></code> objects</a><ul>
<li class="toctree-l3"><a class="reference internal" href="collections.html#deque-recipes">8.3.2.1. <code class="xref py py-class docutils literal notranslate"><span class="pre">deque</span></code> Recipes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="collections.html#defaultdict-objects">8.3.3. <code class="xref py py-class docutils literal notranslate"><span class="pre">defaultdict</span></code> objects</a><ul>
<li class="toctree-l3"><a class="reference internal" href="collections.html#defaultdict-examples">8.3.3.1. <code class="xref py py-class docutils literal notranslate"><span class="pre">defaultdict</span></code> Examples</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="collections.html#namedtuple-factory-function-for-tuples-with-named-fields">8.3.4. <code class="xref py py-func docutils literal notranslate"><span class="pre">namedtuple()</span></code> Factory Function for Tuples with Named Fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="collections.html#ordereddict-objects">8.3.5. <code class="xref py py-class docutils literal notranslate"><span class="pre">OrderedDict</span></code> objects</a><ul>
<li class="toctree-l3"><a class="reference internal" href="collections.html#ordereddict-examples-and-recipes">8.3.5.1. <code class="xref py py-class docutils literal notranslate"><span class="pre">OrderedDict</span></code> Examples and Recipes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="collections.html#collections-abstract-base-classes">8.3.6. Collections Abstract Base Classes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="heapq.html">8.4. <code class="xref py py-mod docutils literal notranslate"><span class="pre">heapq</span></code> — Heap queue algorithm</a><ul>
<li class="toctree-l2"><a class="reference internal" href="heapq.html#basic-examples">8.4.1. Basic Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="heapq.html#priority-queue-implementation-notes">8.4.2. Priority Queue Implementation Notes</a></li>
<li class="toctree-l2"><a class="reference internal" href="heapq.html#theory">8.4.3. Theory</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="bisect.html">8.5. <code class="xref py py-mod docutils literal notranslate"><span class="pre">bisect</span></code> — Array bisection algorithm</a><ul>
<li class="toctree-l2"><a class="reference internal" href="bisect.html#searching-sorted-lists">8.5.1. Searching Sorted Lists</a></li>
<li class="toctree-l2"><a class="reference internal" href="bisect.html#other-examples">8.5.2. Other Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="array.html">8.6. <code class="xref py py-mod docutils literal notranslate"><span class="pre">array</span></code> — Efficient arrays of numeric values</a></li>
<li class="toctree-l1"><a class="reference internal" href="sets.html">8.7. <code class="xref py py-mod docutils literal notranslate"><span class="pre">sets</span></code> — Unordered collections of unique elements</a><ul>
<li class="toctree-l2"><a class="reference internal" href="sets.html#set-objects">8.7.1. Set Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="sets.html#example">8.7.2. Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="sets.html#protocol-for-automatic-conversion-to-immutable">8.7.3. Protocol for automatic conversion to immutable</a></li>
<li class="toctree-l2"><a class="reference internal" href="sets.html#comparison-to-the-built-in-set-types">8.7.4. Comparison to the built-in <code class="xref py py-class docutils literal notranslate"><span class="pre">set</span></code> types</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="sched.html">8.8. <code class="xref py py-mod docutils literal notranslate"><span class="pre">sched</span></code> — Event scheduler</a><ul>
<li class="toctree-l2"><a class="reference internal" href="sched.html#scheduler-objects">8.8.1. Scheduler Objects</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="mutex.html">8.9. <code class="xref py py-mod docutils literal notranslate"><span class="pre">mutex</span></code> — Mutual exclusion support</a><ul>
<li class="toctree-l2"><a class="reference internal" href="mutex.html#mutex-objects">8.9.1. Mutex Objects</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="queue.html">8.10. <code class="xref py py-mod docutils literal notranslate"><span class="pre">Queue</span></code> — A synchronized queue class</a><ul>
<li class="toctree-l2"><a class="reference internal" href="queue.html#queue-objects">8.10.1. Queue Objects</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="weakref.html">8.11. <code class="xref py py-mod docutils literal notranslate"><span class="pre">weakref</span></code> — Weak references</a><ul>
<li class="toctree-l2"><a class="reference internal" href="weakref.html#weak-reference-objects">8.11.1. Weak Reference Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="weakref.html#example">8.11.2. Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="userdict.html">8.12. <code class="xref py py-mod docutils literal notranslate"><span class="pre">UserDict</span></code> — Class wrapper for dictionary objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="userdict.html#module-UserList">8.13. <code class="xref py py-mod docutils literal notranslate"><span class="pre">UserList</span></code> — Class wrapper for list objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="userdict.html#module-UserString">8.14. <code class="xref py py-mod docutils literal notranslate"><span class="pre">UserString</span></code> — Class wrapper for string objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="types.html">8.15. <code class="xref py py-mod docutils literal notranslate"><span class="pre">types</span></code> — Names for built-in types</a></li>
<li class="toctree-l1"><a class="reference internal" href="new.html">8.16. <code class="xref py py-mod docutils literal notranslate"><span class="pre">new</span></code> — Creation of runtime internal objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="copy.html">8.17. <code class="xref py py-mod docutils literal notranslate"><span class="pre">copy</span></code> — Shallow and deep copy operations</a></li>
<li class="toctree-l1"><a class="reference internal" href="pprint.html">8.18. <code class="xref py py-mod docutils literal notranslate"><span class="pre">pprint</span></code> — Data pretty printer</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pprint.html#prettyprinter-objects">8.18.1. PrettyPrinter Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="pprint.html#pprint-example">8.18.2. pprint Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="repr.html">8.19. <code class="xref py py-mod docutils literal notranslate"><span class="pre">repr</span></code> — Alternate <code class="xref py py-func docutils literal notranslate"><span class="pre">repr()</span></code> implementation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="repr.html#repr-objects">8.19.1. Repr Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="repr.html#subclassing-repr-objects">8.19.2. Subclassing Repr Objects</a></li>
</ul>
</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="fpformat.html"
                        title="previous chapter">7.11. <code class="xref py py-mod docutils literal notranslate"><span class="pre">fpformat</span></code> — Floating point conversions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="datetime.html"
                        title="next chapter">8.1. <code class="xref py py-mod docutils literal notranslate"><span class="pre">datetime</span></code> — Basic date and time types</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/library/datatypes.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>  
    <div class="related" role="navigation" aria-label="related navigation">
      <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="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="datetime.html" title="8.1. datetime — Basic date and time types"
             >next</a> |</li>
        <li class="right" >
          <a href="fpformat.html" title="7.11. fpformat — Floating point conversions"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.17 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Oct 19, 2019.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.0.1.
    </div>

  </body>
</html>