parthtamu/rag-code-assistant
0
1<!DOCTYPE html>2 3<html lang="en" data-content_root="../">4 <head>5 <meta charset="utf-8" />6 <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />7<meta property="og:title" content="Data Types" />8<meta property="og:type" content="website" />9<meta property="og:url" content="https://docs.python.org/3/library/datatypes.html" />10<meta property="og:site_name" content="Python documentation" />11<meta property="og:description" content="The modules described in this chapter provide a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, double-ended queues, and enumerations. Python also provide..." />12<meta property="og:image:width" content="1146" />13<meta property="og:image:height" content="600" />14<meta property="og:image" content="https://docs.python.org/3.15/_images/social_previews/summary_library_datatypes_091b78fe.png" />15<meta property="og:image:alt" content="The modules described in this chapter provide a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, double-ended queues, and enumerations. Python also provide..." />16<meta name="description" content="The modules described in this chapter provide a variety of specialized data types such as dates and times, fixed-type arrays, heap queues, double-ended queues, and enumerations. Python also provide..." />17<meta name="twitter:card" content="summary_large_image" />18<meta name="theme-color" content="#3776ab">19 20 <title>Data Types — Python 3.15.0a6 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">21 22 <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />23 <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=234b1a7c" />24 <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=89a2f22a" />25 <link rel="stylesheet" type="text/css" href="../_static/profiling-sampling-visualization.css?v=0c2600ae" />26 <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=5349f25f" />27 28 <script src="../_static/documentation_options.js?v=6b7c9ff5"></script>29 <script src="../_static/doctools.js?v=9bcbadda"></script>30 <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>31 <script src="../_static/profiling-sampling-visualization.js?v=9811ed04"></script>32 33 <script src="../_static/sidebar.js"></script>34 35 <link rel="search" type="application/opensearchdescription+xml"36 title="Search within Python 3.15.0a6 documentation"37 href="../_static/opensearch.xml"/>38 <link rel="author" title="About these documents" href="../about.html" />39 <link rel="index" title="Index" href="../genindex.html" />40 <link rel="search" title="Search" href="../search.html" />41 <link rel="copyright" title="Copyright" href="../copyright.html" />42 <link rel="next" title="datetime — Basic date and time types" href="datetime.html" />43 <link rel="prev" title="codecs — Codec registry and base classes" href="codecs.html" />44 45 46 <script defer file-types="bz2,epub,zip" data-domain="docs.python.org" src="https://analytics.python.org/js/script.file-downloads.outbound-links.js"></script>47 48 <link rel="canonical" href="https://docs.python.org/3/library/datatypes.html">49 50 51 52 53 <style>54 @media only screen {55 table.full-width-table {56 width: 100%;57 }58 }59 </style>60<link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">61 <link rel="shortcut icon" type="image/png" href="../_static/py.svg">62 <script type="text/javascript" src="../_static/copybutton.js"></script>63 <script type="text/javascript" src="../_static/menu.js"></script>64 <script type="text/javascript" src="../_static/search-focus.js"></script>65 <script type="text/javascript" src="../_static/themetoggle.js"></script> 66 <script type="text/javascript" src="../_static/rtd_switcher.js"></script>67 <meta name="readthedocs-addons-api-version" content="1">68 69 </head>70<body>71<div class="mobile-nav">72 <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"73 aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu">74 <nav class="nav-content" role="navigation">75 <label for="menuToggler" class="toggler__label">76 <span></span>77 </label>78 <span class="nav-items-wrapper">79 <a href="https://www.python.org/" class="nav-logo">80 <img src="../_static/py.svg" alt="Python logo">81 </a>82 <span class="version_switcher_placeholder"></span>83 <form role="search" class="search" action="../search.html" method="get">84 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">85 <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>86 </svg>87 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q">88 <input type="submit" value="Go">89 </form>90 </span>91 </nav>92 <div class="menu-wrapper">93 <nav class="menu" role="navigation" aria-label="main navigation">94 <div class="language_switcher_placeholder"></div>95 96<label class="theme-selector-label">97 Theme98 <select class="theme-selector" oninput="activateTheme(this.value)">99 <option value="auto" selected>Auto</option>100 <option value="light">Light</option>101 <option value="dark">Dark</option>102 </select>103</label>104 <div>105 <h4>Previous topic</h4>106 <p class="topless"><a href="codecs.html"107 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">codecs</span></code> — Codec registry and base classes</a></p>108 </div>109 <div>110 <h4>Next topic</h4>111 <p class="topless"><a href="datetime.html"112 title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">datetime</span></code> — Basic date and time types</a></p>113 </div>114 <script>115 document.addEventListener('DOMContentLoaded', () => {116 const title = document.querySelector('meta[property="og:title"]').content;117 const elements = document.querySelectorAll('.improvepage');118 const pageurl = window.location.href.split('?')[0];119 elements.forEach(element => {120 const url = new URL(element.href.split('?')[0].replace("-nojs", ""));121 url.searchParams.set('pagetitle', title);122 url.searchParams.set('pageurl', pageurl);123 url.searchParams.set('pagesource', "library/datatypes.rst");124 element.href = url.toString();125 });126 });127 </script>128 <div role="note" aria-label="source link">129 <h3>This page</h3>130 <ul class="this-page-menu">131 <li><a href="../bugs.html">Report a bug</a></li>132 <li><a class="improvepage" href="../improve-page-nojs.html">Improve this page</a></li>133 <li>134 <a href="https://github.com/python/cpython/blob/main/Doc/library/datatypes.rst?plain=1"135 rel="nofollow">Show source136 </a>137 </li>138 139 </ul>140 </div>141 </nav>142 </div>143</div>144 145 146 <div class="related" role="navigation" aria-label="Related">147 <h3>Navigation</h3>148 <ul>149 <li class="right" style="margin-right: 10px">150 <a href="../genindex.html" title="General Index"151 accesskey="I">index</a></li>152 <li class="right" >153 <a href="../py-modindex.html" title="Python Module Index"154 >modules</a> |</li>155 <li class="right" >156 <a href="datetime.html" title="datetime — Basic date and time types"157 accesskey="N">next</a> |</li>158 <li class="right" >159 <a href="codecs.html" title="codecs — Codec registry and base classes"160 accesskey="P">previous</a> |</li>161 162 <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"></li>163 <li><a href="https://www.python.org/">Python</a> »</li>164 <li class="switchers">165 <div class="language_switcher_placeholder"></div>166 <div class="version_switcher_placeholder"></div>167 </li>168 <li>169 170 </li>171 <li id="cpython-language-and-version">172 <a href="../index.html">3.15.0a6 Documentation</a> »173 </li>174 175 <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> »</li>176 <li class="nav-item nav-item-this"><a href="">Data Types</a></li>177 <li class="right">178 179 180 <div class="inline-search" role="search">181 <form class="inline-search" action="../search.html" method="get">182 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box">183 <input type="submit" value="Go">184 </form>185 </div>186 |187 </li>188 <li class="right">189<label class="theme-selector-label">190 Theme191 <select class="theme-selector" oninput="activateTheme(this.value)">192 <option value="auto" selected>Auto</option>193 <option value="light">Light</option>194 <option value="dark">Dark</option>195 </select>196</label> |</li>197 198 </ul>199 </div> 200 201 <div class="document">202 <div class="documentwrapper">203 <div class="bodywrapper">204 <div class="body" role="main">205 206 <section id="data-types">207<span id="datatypes"></span><h1>Data Types<a class="headerlink" href="#data-types" title="Link to this heading">¶</a></h1>208<p>The modules described in this chapter provide a variety of specialized data209types such as dates and times, fixed-type arrays, heap queues, double-ended210queues, and enumerations.</p>211<p>Python also provides some built-in data types, in particular,212<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>, <a class="reference internal" href="stdtypes.html#list" title="list"><code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></a>, <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> and <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>, and213<a class="reference internal" href="stdtypes.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="stdtypes.html#str" title="str"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a> class is used to hold214Unicode strings, and the <a class="reference internal" href="stdtypes.html#bytes" title="bytes"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></a> and <a class="reference internal" href="stdtypes.html#bytearray" title="bytearray"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytearray</span></code></a> classes are used215to hold binary data.</p>216<p>The following modules are documented in this chapter:</p>217<div class="toctree-wrapper compound">218<ul>219<li class="toctree-l1"><a class="reference internal" href="datetime.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">datetime</span></code> — Basic date and time types</a><ul>220<li class="toctree-l2"><a class="reference internal" href="datetime.html#aware-and-naive-objects">Aware and naive objects</a></li>221<li class="toctree-l2"><a class="reference internal" href="datetime.html#constants">Constants</a></li>222<li class="toctree-l2"><a class="reference internal" href="datetime.html#available-types">Available types</a><ul>223<li class="toctree-l3"><a class="reference internal" href="datetime.html#common-properties">Common properties</a></li>224<li class="toctree-l3"><a class="reference internal" href="datetime.html#determining-if-an-object-is-aware-or-naive">Determining if an object is aware or naive</a></li>225</ul>226</li>227<li class="toctree-l2"><a class="reference internal" href="datetime.html#timedelta-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">timedelta</span></code> objects</a><ul>228<li class="toctree-l3"><a class="reference internal" href="datetime.html#examples-of-usage-timedelta">Examples of usage: <code class="xref py py-class docutils literal notranslate"><span class="pre">timedelta</span></code></a></li>229</ul>230</li>231<li class="toctree-l2"><a class="reference internal" href="datetime.html#date-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">date</span></code> objects</a><ul>232<li class="toctree-l3"><a class="reference internal" href="datetime.html#examples-of-usage-date">Examples of usage: <code class="xref py py-class docutils literal notranslate"><span class="pre">date</span></code></a></li>233</ul>234</li>235<li class="toctree-l2"><a class="reference internal" href="datetime.html#datetime-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code> objects</a><ul>236<li class="toctree-l3"><a class="reference internal" href="datetime.html#examples-of-usage-datetime">Examples of usage: <code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code></a></li>237</ul>238</li>239<li class="toctree-l2"><a class="reference internal" href="datetime.html#time-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">time</span></code> objects</a><ul>240<li class="toctree-l3"><a class="reference internal" href="datetime.html#examples-of-usage-time">Examples of usage: <code class="xref py py-class docutils literal notranslate"><span class="pre">time</span></code></a></li>241</ul>242</li>243<li class="toctree-l2"><a class="reference internal" href="datetime.html#tzinfo-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">tzinfo</span></code> objects</a></li>244<li class="toctree-l2"><a class="reference internal" href="datetime.html#timezone-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">timezone</span></code> objects</a></li>245<li class="toctree-l2"><a class="reference internal" href="datetime.html#strftime-and-strptime-behavior"><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><ul>246<li class="toctree-l3"><a class="reference internal" href="datetime.html#strftime-and-strptime-format-codes"><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> format codes</a></li>247<li class="toctree-l3"><a class="reference internal" href="datetime.html#technical-detail">Technical detail</a></li>248</ul>249</li>250</ul>251</li>252<li class="toctree-l1"><a class="reference internal" href="zoneinfo.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">zoneinfo</span></code> — IANA time zone support</a><ul>253<li class="toctree-l2"><a class="reference internal" href="zoneinfo.html#using-zoneinfo">Using <code class="docutils literal notranslate"><span class="pre">ZoneInfo</span></code></a></li>254<li class="toctree-l2"><a class="reference internal" href="zoneinfo.html#data-sources">Data sources</a><ul>255<li class="toctree-l3"><a class="reference internal" href="zoneinfo.html#configuring-the-data-sources">Configuring the data sources</a><ul>256<li class="toctree-l4"><a class="reference internal" href="zoneinfo.html#compile-time-configuration">Compile-time configuration</a></li>257<li class="toctree-l4"><a class="reference internal" href="zoneinfo.html#environment-configuration">Environment configuration</a></li>258<li class="toctree-l4"><a class="reference internal" href="zoneinfo.html#runtime-configuration">Runtime configuration</a></li>259</ul>260</li>261</ul>262</li>263<li class="toctree-l2"><a class="reference internal" href="zoneinfo.html#the-zoneinfo-class">The <code class="docutils literal notranslate"><span class="pre">ZoneInfo</span></code> class</a><ul>264<li class="toctree-l3"><a class="reference internal" href="zoneinfo.html#string-representations">String representations</a></li>265<li class="toctree-l3"><a class="reference internal" href="zoneinfo.html#pickle-serialization">Pickle serialization</a></li>266</ul>267</li>268<li class="toctree-l2"><a class="reference internal" href="zoneinfo.html#functions">Functions</a></li>269<li class="toctree-l2"><a class="reference internal" href="zoneinfo.html#globals">Globals</a></li>270<li class="toctree-l2"><a class="reference internal" href="zoneinfo.html#exceptions-and-warnings">Exceptions and warnings</a></li>271</ul>272</li>273<li class="toctree-l1"><a class="reference internal" href="calendar.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">calendar</span></code> — General calendar-related functions</a><ul>274<li class="toctree-l2"><a class="reference internal" href="calendar.html#command-line-usage">Command-line usage</a></li>275</ul>276</li>277<li class="toctree-l1"><a class="reference internal" href="collections.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">collections</span></code> — Container datatypes</a><ul>278<li class="toctree-l2"><a class="reference internal" href="collections.html#chainmap-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">ChainMap</span></code> objects</a><ul>279<li class="toctree-l3"><a class="reference internal" href="collections.html#chainmap-examples-and-recipes"><code class="xref py py-class docutils literal notranslate"><span class="pre">ChainMap</span></code> Examples and Recipes</a></li>280</ul>281</li>282<li class="toctree-l2"><a class="reference internal" href="collections.html#counter-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">Counter</span></code> objects</a></li>283<li class="toctree-l2"><a class="reference internal" href="collections.html#deque-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">deque</span></code> objects</a><ul>284<li class="toctree-l3"><a class="reference internal" href="collections.html#deque-recipes"><code class="xref py py-class docutils literal notranslate"><span class="pre">deque</span></code> Recipes</a></li>285</ul>286</li>287<li class="toctree-l2"><a class="reference internal" href="collections.html#defaultdict-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">defaultdict</span></code> objects</a><ul>288<li class="toctree-l3"><a class="reference internal" href="collections.html#defaultdict-examples"><code class="xref py py-class docutils literal notranslate"><span class="pre">defaultdict</span></code> Examples</a></li>289</ul>290</li>291<li class="toctree-l2"><a class="reference internal" href="collections.html#namedtuple-factory-function-for-tuples-with-named-fields"><code class="xref py py-func docutils literal notranslate"><span class="pre">namedtuple()</span></code> Factory Function for Tuples with Named Fields</a></li>292<li class="toctree-l2"><a class="reference internal" href="collections.html#ordereddict-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">OrderedDict</span></code> objects</a><ul>293<li class="toctree-l3"><a class="reference internal" href="collections.html#ordereddict-examples-and-recipes"><code class="xref py py-class docutils literal notranslate"><span class="pre">OrderedDict</span></code> Examples and Recipes</a></li>294</ul>295</li>296<li class="toctree-l2"><a class="reference internal" href="collections.html#userdict-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">UserDict</span></code> objects</a></li>297<li class="toctree-l2"><a class="reference internal" href="collections.html#userlist-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">UserList</span></code> objects</a></li>298<li class="toctree-l2"><a class="reference internal" href="collections.html#userstring-objects"><code class="xref py py-class docutils literal notranslate"><span class="pre">UserString</span></code> objects</a></li>299</ul>300</li>301<li class="toctree-l1"><a class="reference internal" href="collections.abc.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">collections.abc</span></code> — Abstract Base Classes for Containers</a><ul>302<li class="toctree-l2"><a class="reference internal" href="collections.abc.html#collections-abstract-base-classes">Collections Abstract Base Classes</a></li>303<li class="toctree-l2"><a class="reference internal" href="collections.abc.html#collections-abstract-base-classes-detailed-descriptions">Collections Abstract Base Classes – Detailed Descriptions</a></li>304<li class="toctree-l2"><a class="reference internal" href="collections.abc.html#examples-and-recipes">Examples and Recipes</a></li>305</ul>306</li>307<li class="toctree-l1"><a class="reference internal" href="heapq.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">heapq</span></code> — Heap queue algorithm</a><ul>308<li class="toctree-l2"><a class="reference internal" href="heapq.html#basic-examples">Basic Examples</a></li>309<li class="toctree-l2"><a class="reference internal" href="heapq.html#other-applications">Other Applications</a></li>310<li class="toctree-l2"><a class="reference internal" href="heapq.html#priority-queue-implementation-notes">Priority Queue Implementation Notes</a></li>311<li class="toctree-l2"><a class="reference internal" href="heapq.html#theory">Theory</a></li>312</ul>313</li>314<li class="toctree-l1"><a class="reference internal" href="bisect.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">bisect</span></code> — Array bisection algorithm</a><ul>315<li class="toctree-l2"><a class="reference internal" href="bisect.html#performance-notes">Performance Notes</a></li>316<li class="toctree-l2"><a class="reference internal" href="bisect.html#searching-sorted-lists">Searching Sorted Lists</a></li>317<li class="toctree-l2"><a class="reference internal" href="bisect.html#examples">Examples</a></li>318</ul>319</li>320<li class="toctree-l1"><a class="reference internal" href="array.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">array</span></code> — Efficient arrays of numeric values</a></li>321<li class="toctree-l1"><a class="reference internal" href="weakref.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">weakref</span></code> — Weak references</a><ul>322<li class="toctree-l2"><a class="reference internal" href="weakref.html#weak-reference-objects">Weak Reference Objects</a></li>323<li class="toctree-l2"><a class="reference internal" href="weakref.html#example">Example</a></li>324<li class="toctree-l2"><a class="reference internal" href="weakref.html#finalizer-objects">Finalizer Objects</a></li>325<li class="toctree-l2"><a class="reference internal" href="weakref.html#comparing-finalizers-with-del-methods">Comparing finalizers with <code class="xref py py-meth docutils literal notranslate"><span class="pre">__del__()</span></code> methods</a></li>326</ul>327</li>328<li class="toctree-l1"><a class="reference internal" href="types.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">types</span></code> — Dynamic type creation and names for built-in types</a><ul>329<li class="toctree-l2"><a class="reference internal" href="types.html#dynamic-type-creation">Dynamic Type Creation</a></li>330<li class="toctree-l2"><a class="reference internal" href="types.html#standard-interpreter-types">Standard Interpreter Types</a></li>331<li class="toctree-l2"><a class="reference internal" href="types.html#additional-utility-classes-and-functions">Additional Utility Classes and Functions</a></li>332<li class="toctree-l2"><a class="reference internal" href="types.html#coroutine-utility-functions">Coroutine Utility Functions</a></li>333</ul>334</li>335<li class="toctree-l1"><a class="reference internal" href="copy.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">copy</span></code> — Shallow and deep copy operations</a></li>336<li class="toctree-l1"><a class="reference internal" href="pprint.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pprint</span></code> — Data pretty printer</a><ul>337<li class="toctree-l2"><a class="reference internal" href="pprint.html#functions">Functions</a></li>338<li class="toctree-l2"><a class="reference internal" href="pprint.html#prettyprinter-objects">PrettyPrinter Objects</a></li>339<li class="toctree-l2"><a class="reference internal" href="pprint.html#example">Example</a></li>340</ul>341</li>342<li class="toctree-l1"><a class="reference internal" href="reprlib.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">reprlib</span></code> — Alternate <code class="xref py py-func docutils literal notranslate"><span class="pre">repr()</span></code> implementation</a><ul>343<li class="toctree-l2"><a class="reference internal" href="reprlib.html#repr-objects">Repr Objects</a></li>344<li class="toctree-l2"><a class="reference internal" href="reprlib.html#subclassing-repr-objects">Subclassing Repr Objects</a></li>345</ul>346</li>347<li class="toctree-l1"><a class="reference internal" href="enum.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">enum</span></code> — Support for enumerations</a><ul>348<li class="toctree-l2"><a class="reference internal" href="enum.html#module-contents">Module Contents</a></li>349<li class="toctree-l2"><a class="reference internal" href="enum.html#data-types">Data Types</a><ul>350<li class="toctree-l3"><a class="reference internal" href="enum.html#supported-dunder-names">Supported <code class="docutils literal notranslate"><span class="pre">__dunder__</span></code> names</a></li>351<li class="toctree-l3"><a class="reference internal" href="enum.html#supported-sunder-names">Supported <code class="docutils literal notranslate"><span class="pre">_sunder_</span></code> names</a></li>352</ul>353</li>354<li class="toctree-l2"><a class="reference internal" href="enum.html#utilities-and-decorators">Utilities and Decorators</a></li>355<li class="toctree-l2"><a class="reference internal" href="enum.html#notes">Notes</a></li>356</ul>357</li>358<li class="toctree-l1"><a class="reference internal" href="graphlib.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">graphlib</span></code> — Functionality to operate with graph-like structures</a><ul>359<li class="toctree-l2"><a class="reference internal" href="graphlib.html#exceptions">Exceptions</a></li>360</ul>361</li>362</ul>363</div>364</section>365 366 367 <div class="clearer"></div>368 </div>369 </div>370 </div>371 <div class="sphinxsidebar" role="navigation" aria-label="Main">372 <div class="sphinxsidebarwrapper">373 <div>374 <h4>Previous topic</h4>375 <p class="topless"><a href="codecs.html"376 title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">codecs</span></code> — Codec registry and base classes</a></p>377 </div>378 <div>379 <h4>Next topic</h4>380 <p class="topless"><a href="datetime.html"381 title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">datetime</span></code> — Basic date and time types</a></p>382 </div>383 <script>384 document.addEventListener('DOMContentLoaded', () => {385 const title = document.querySelector('meta[property="og:title"]').content;386 const elements = document.querySelectorAll('.improvepage');387 const pageurl = window.location.href.split('?')[0];388 elements.forEach(element => {389 const url = new URL(element.href.split('?')[0].replace("-nojs", ""));390 url.searchParams.set('pagetitle', title);391 url.searchParams.set('pageurl', pageurl);392 url.searchParams.set('pagesource', "library/datatypes.rst");393 element.href = url.toString();394 });395 });396 </script>397 <div role="note" aria-label="source link">398 <h3>This page</h3>399 <ul class="this-page-menu">400 <li><a href="../bugs.html">Report a bug</a></li>401 <li><a class="improvepage" href="../improve-page-nojs.html">Improve this page</a></li>402 <li>403 <a href="https://github.com/python/cpython/blob/main/Doc/library/datatypes.rst?plain=1"404 rel="nofollow">Show source405 </a>406 </li>407 408 </ul>409 </div>410 </div>411<div id="sidebarbutton" title="Collapse sidebar">412<span>«</span>413</div>414 415 </div>416 <div class="clearer"></div>417 </div> 418 <div class="related" role="navigation" aria-label="Related">419 <h3>Navigation</h3>420 <ul>421 <li class="right" style="margin-right: 10px">422 <a href="../genindex.html" title="General Index"423 >index</a></li>424 <li class="right" >425 <a href="../py-modindex.html" title="Python Module Index"426 >modules</a> |</li>427 <li class="right" >428 <a href="datetime.html" title="datetime — Basic date and time types"429 >next</a> |</li>430 <li class="right" >431 <a href="codecs.html" title="codecs — Codec registry and base classes"432 >previous</a> |</li>433 434 <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"></li>435 <li><a href="https://www.python.org/">Python</a> »</li>436 <li class="switchers">437 <div class="language_switcher_placeholder"></div>438 <div class="version_switcher_placeholder"></div>439 </li>440 <li>441 442 </li>443 <li id="cpython-language-and-version">444 <a href="../index.html">3.15.0a6 Documentation</a> »445 </li>446 447 <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>448 <li class="nav-item nav-item-this"><a href="">Data Types</a></li>449 <li class="right">450 451 452 <div class="inline-search" role="search">453 <form class="inline-search" action="../search.html" method="get">454 <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box">455 <input type="submit" value="Go">456 </form>457 </div>458 |459 </li>460 <li class="right">461<label class="theme-selector-label">462 Theme463 <select class="theme-selector" oninput="activateTheme(this.value)">464 <option value="auto" selected>Auto</option>465 <option value="light">Light</option>466 <option value="dark">Dark</option>467 </select>468</label> |</li>469 470 </ul>471 </div> 472 <div class="footer">473 © <a href="../copyright.html">Copyright</a> 2001 Python Software Foundation.474 <br>475 This page is licensed under the Python Software Foundation License Version 2.476 <br>477 Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.478 <br>479 480 See <a href="/license.html">History and License</a> for more information.<br>481 482 483 <br>484 485 The Python Software Foundation is a non-profit corporation.486<a href="https://www.python.org/psf/donations/">Please donate.</a>487<br>488 <br>489 Last updated on Mar 10, 2026 (08:58 UTC).490 491 <a href="/bugs.html">Found a bug</a>?492 493 <br>494 495 Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.496 </div>497 498 </body>499</html>