sequence.html 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
  6. <meta property="og:title" content="Sequence Protocol" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/c-api/sequence.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  11. <meta property="og:image:alt" content="Python documentation" />
  12. <meta property="og:image:width" content="200" />
  13. <meta property="og:image:height" content="200" />
  14. <meta name="theme-color" content="#3776ab" />
  15. <title>Sequence Protocol &#8212; Python 3.12.0 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  16. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  17. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" />
  18. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css" />
  19. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  20. <script src="../_static/jquery.js"></script>
  21. <script src="../_static/underscore.js"></script>
  22. <script src="../_static/doctools.js"></script>
  23. <script src="../_static/sidebar.js"></script>
  24. <link rel="search" type="application/opensearchdescription+xml"
  25. title="Search within Python 3.12.0 documentation"
  26. href="../_static/opensearch.xml"/>
  27. <link rel="author" title="About these documents" href="../about.html" />
  28. <link rel="index" title="Index" href="../genindex.html" />
  29. <link rel="search" title="Search" href="../search.html" />
  30. <link rel="copyright" title="Copyright" href="../copyright.html" />
  31. <link rel="next" title="Mapping Protocol" href="mapping.html" />
  32. <link rel="prev" title="Number Protocol" href="number.html" />
  33. <link rel="canonical" href="https://docs.python.org/3/c-api/sequence.html" />
  34. <style>
  35. @media only screen {
  36. table.full-width-table {
  37. width: 100%;
  38. }
  39. }
  40. </style>
  41. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  42. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  43. <script type="text/javascript" src="../_static/copybutton.js"></script>
  44. <script type="text/javascript" src="../_static/menu.js"></script>
  45. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  46. </head>
  47. <body>
  48. <div class="mobile-nav">
  49. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  50. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  51. <nav class="nav-content" role="navigation">
  52. <label for="menuToggler" class="toggler__label">
  53. <span></span>
  54. </label>
  55. <span class="nav-items-wrapper">
  56. <a href="https://www.python.org/" class="nav-logo">
  57. <img src="../_static/py.svg" alt="Logo"/>
  58. </a>
  59. <span class="version_switcher_placeholder"></span>
  60. <form role="search" class="search" action="../search.html" method="get">
  61. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  62. <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>
  63. </svg>
  64. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  65. <input type="submit" value="Go"/>
  66. </form>
  67. </span>
  68. </nav>
  69. <div class="menu-wrapper">
  70. <nav class="menu" role="navigation" aria-label="main navigation">
  71. <div class="language_switcher_placeholder"></div>
  72. <label class="theme-selector-label">
  73. Theme
  74. <select class="theme-selector" oninput="activateTheme(this.value)">
  75. <option value="auto" selected>Auto</option>
  76. <option value="light">Light</option>
  77. <option value="dark">Dark</option>
  78. </select>
  79. </label>
  80. <div>
  81. <h4>Previous topic</h4>
  82. <p class="topless"><a href="number.html"
  83. title="previous chapter">Number Protocol</a></p>
  84. </div>
  85. <div>
  86. <h4>Next topic</h4>
  87. <p class="topless"><a href="mapping.html"
  88. title="next chapter">Mapping Protocol</a></p>
  89. </div>
  90. <div role="note" aria-label="source link">
  91. <h3>This Page</h3>
  92. <ul class="this-page-menu">
  93. <li><a href="../bugs.html">Report a Bug</a></li>
  94. <li>
  95. <a href="https://github.com/python/cpython/blob/main/Doc/c-api/sequence.rst"
  96. rel="nofollow">Show Source
  97. </a>
  98. </li>
  99. </ul>
  100. </div>
  101. </nav>
  102. </div>
  103. </div>
  104. <div class="related" role="navigation" aria-label="related navigation">
  105. <h3>Navigation</h3>
  106. <ul>
  107. <li class="right" style="margin-right: 10px">
  108. <a href="../genindex.html" title="General Index"
  109. accesskey="I">index</a></li>
  110. <li class="right" >
  111. <a href="../py-modindex.html" title="Python Module Index"
  112. >modules</a> |</li>
  113. <li class="right" >
  114. <a href="mapping.html" title="Mapping Protocol"
  115. accesskey="N">next</a> |</li>
  116. <li class="right" >
  117. <a href="number.html" title="Number Protocol"
  118. accesskey="P">previous</a> |</li>
  119. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  120. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  121. <li class="switchers">
  122. <div class="language_switcher_placeholder"></div>
  123. <div class="version_switcher_placeholder"></div>
  124. </li>
  125. <li>
  126. </li>
  127. <li id="cpython-language-and-version">
  128. <a href="../index.html">3.12.0 Documentation</a> &#187;
  129. </li>
  130. <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &#187;</li>
  131. <li class="nav-item nav-item-2"><a href="abstract.html" accesskey="U">Abstract Objects Layer</a> &#187;</li>
  132. <li class="nav-item nav-item-this"><a href="">Sequence Protocol</a></li>
  133. <li class="right">
  134. <div class="inline-search" role="search">
  135. <form class="inline-search" action="../search.html" method="get">
  136. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  137. <input type="submit" value="Go" />
  138. </form>
  139. </div>
  140. |
  141. </li>
  142. <li class="right">
  143. <label class="theme-selector-label">
  144. Theme
  145. <select class="theme-selector" oninput="activateTheme(this.value)">
  146. <option value="auto" selected>Auto</option>
  147. <option value="light">Light</option>
  148. <option value="dark">Dark</option>
  149. </select>
  150. </label> |</li>
  151. </ul>
  152. </div>
  153. <div class="document">
  154. <div class="documentwrapper">
  155. <div class="bodywrapper">
  156. <div class="body" role="main">
  157. <section id="sequence-protocol">
  158. <span id="sequence"></span><h1>Sequence Protocol<a class="headerlink" href="#sequence-protocol" title="Permalink to this headline">¶</a></h1>
  159. <dl class="c function">
  160. <dt class="sig sig-object c" id="c.PySequence_Check">
  161. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Check</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Check" title="Permalink to this definition">¶</a><br /></dt>
  162. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return <code class="docutils literal notranslate"><span class="pre">1</span></code> if the object provides the sequence protocol, and <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise.
  163. Note that it returns <code class="docutils literal notranslate"><span class="pre">1</span></code> for Python classes with a <a class="reference internal" href="../reference/datamodel.html#object.__getitem__" title="object.__getitem__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__getitem__()</span></code></a>
  164. method, unless they are <a class="reference internal" href="../library/stdtypes.html#dict" title="dict"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> subclasses, since in general it
  165. is impossible to determine what type of keys the class supports. This
  166. function always succeeds.</p>
  167. </dd></dl>
  168. <dl class="c function">
  169. <dt class="sig sig-object c" id="c.PySequence_Size">
  170. <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Size</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Size" title="Permalink to this definition">¶</a><br /></dt>
  171. <dt class="sig sig-object c" id="c.PySequence_Length">
  172. <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Length</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Length" title="Permalink to this definition">¶</a><br /></dt>
  173. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p id="index-0">Returns the number of objects in sequence <em>o</em> on success, and <code class="docutils literal notranslate"><span class="pre">-1</span></code> on
  174. failure. This is equivalent to the Python expression <code class="docutils literal notranslate"><span class="pre">len(o)</span></code>.</p>
  175. </dd></dl>
  176. <dl class="c function">
  177. <dt class="sig sig-object c" id="c.PySequence_Concat">
  178. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Concat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o1</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o2</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Concat" title="Permalink to this definition">¶</a><br /></dt>
  179. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the concatenation of <em>o1</em> and <em>o2</em> on success, and <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure.
  180. This is the equivalent of the Python expression <code class="docutils literal notranslate"><span class="pre">o1</span> <span class="pre">+</span> <span class="pre">o2</span></code>.</p>
  181. </dd></dl>
  182. <dl class="c function">
  183. <dt class="sig sig-object c" id="c.PySequence_Repeat">
  184. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Repeat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">count</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Repeat" title="Permalink to this definition">¶</a><br /></dt>
  185. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the result of repeating sequence object <em>o</em> <em>count</em> times, or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on
  186. failure. This is the equivalent of the Python expression <code class="docutils literal notranslate"><span class="pre">o</span> <span class="pre">*</span> <span class="pre">count</span></code>.</p>
  187. </dd></dl>
  188. <dl class="c function">
  189. <dt class="sig sig-object c" id="c.PySequence_InPlaceConcat">
  190. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_InPlaceConcat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o1</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o2</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_InPlaceConcat" title="Permalink to this definition">¶</a><br /></dt>
  191. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the concatenation of <em>o1</em> and <em>o2</em> on success, and <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure.
  192. The operation is done <em>in-place</em> when <em>o1</em> supports it. This is the equivalent
  193. of the Python expression <code class="docutils literal notranslate"><span class="pre">o1</span> <span class="pre">+=</span> <span class="pre">o2</span></code>.</p>
  194. </dd></dl>
  195. <dl class="c function">
  196. <dt class="sig sig-object c" id="c.PySequence_InPlaceRepeat">
  197. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_InPlaceRepeat</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">count</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_InPlaceRepeat" title="Permalink to this definition">¶</a><br /></dt>
  198. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the result of repeating sequence object <em>o</em> <em>count</em> times, or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on
  199. failure. The operation is done <em>in-place</em> when <em>o</em> supports it. This is the
  200. equivalent of the Python expression <code class="docutils literal notranslate"><span class="pre">o</span> <span class="pre">*=</span> <span class="pre">count</span></code>.</p>
  201. </dd></dl>
  202. <dl class="c function">
  203. <dt class="sig sig-object c" id="c.PySequence_GetItem">
  204. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_GetItem</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_GetItem" title="Permalink to this definition">¶</a><br /></dt>
  205. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the <em>i</em>th element of <em>o</em>, or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure. This is the equivalent of
  206. the Python expression <code class="docutils literal notranslate"><span class="pre">o[i]</span></code>.</p>
  207. </dd></dl>
  208. <dl class="c function">
  209. <dt class="sig sig-object c" id="c.PySequence_GetSlice">
  210. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_GetSlice</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i1</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i2</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_GetSlice" title="Permalink to this definition">¶</a><br /></dt>
  211. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the slice of sequence object <em>o</em> between <em>i1</em> and <em>i2</em>, or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on
  212. failure. This is the equivalent of the Python expression <code class="docutils literal notranslate"><span class="pre">o[i1:i2]</span></code>.</p>
  213. </dd></dl>
  214. <dl class="c function">
  215. <dt class="sig sig-object c" id="c.PySequence_SetItem">
  216. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_SetItem</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">v</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_SetItem" title="Permalink to this definition">¶</a><br /></dt>
  217. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Assign object <em>v</em> to the <em>i</em>th element of <em>o</em>. Raise an exception
  218. and return <code class="docutils literal notranslate"><span class="pre">-1</span></code> on failure; return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success. This
  219. is the equivalent of the Python statement <code class="docutils literal notranslate"><span class="pre">o[i]</span> <span class="pre">=</span> <span class="pre">v</span></code>. This function <em>does
  220. not</em> steal a reference to <em>v</em>.</p>
  221. <p>If <em>v</em> is <code class="docutils literal notranslate"><span class="pre">NULL</span></code>, the element is deleted, but this feature is
  222. deprecated in favour of using <a class="reference internal" href="#c.PySequence_DelItem" title="PySequence_DelItem"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_DelItem()</span></code></a>.</p>
  223. </dd></dl>
  224. <dl class="c function">
  225. <dt class="sig sig-object c" id="c.PySequence_DelItem">
  226. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_DelItem</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_DelItem" title="Permalink to this definition">¶</a><br /></dt>
  227. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Delete the <em>i</em>th element of object <em>o</em>. Returns <code class="docutils literal notranslate"><span class="pre">-1</span></code> on failure. This is the
  228. equivalent of the Python statement <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">o[i]</span></code>.</p>
  229. </dd></dl>
  230. <dl class="c function">
  231. <dt class="sig sig-object c" id="c.PySequence_SetSlice">
  232. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_SetSlice</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i1</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i2</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">v</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_SetSlice" title="Permalink to this definition">¶</a><br /></dt>
  233. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Assign the sequence object <em>v</em> to the slice in sequence object <em>o</em> from <em>i1</em> to
  234. <em>i2</em>. This is the equivalent of the Python statement <code class="docutils literal notranslate"><span class="pre">o[i1:i2]</span> <span class="pre">=</span> <span class="pre">v</span></code>.</p>
  235. </dd></dl>
  236. <dl class="c function">
  237. <dt class="sig sig-object c" id="c.PySequence_DelSlice">
  238. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_DelSlice</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i1</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i2</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_DelSlice" title="Permalink to this definition">¶</a><br /></dt>
  239. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Delete the slice in sequence object <em>o</em> from <em>i1</em> to <em>i2</em>. Returns <code class="docutils literal notranslate"><span class="pre">-1</span></code> on
  240. failure. This is the equivalent of the Python statement <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">o[i1:i2]</span></code>.</p>
  241. </dd></dl>
  242. <dl class="c function">
  243. <dt class="sig sig-object c" id="c.PySequence_Count">
  244. <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Count</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Count" title="Permalink to this definition">¶</a><br /></dt>
  245. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the number of occurrences of <em>value</em> in <em>o</em>, that is, return the number
  246. of keys for which <code class="docutils literal notranslate"><span class="pre">o[key]</span> <span class="pre">==</span> <span class="pre">value</span></code>. On failure, return <code class="docutils literal notranslate"><span class="pre">-1</span></code>. This is
  247. equivalent to the Python expression <code class="docutils literal notranslate"><span class="pre">o.count(value)</span></code>.</p>
  248. </dd></dl>
  249. <dl class="c function">
  250. <dt class="sig sig-object c" id="c.PySequence_Contains">
  251. <span class="kt"><span class="pre">int</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Contains</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Contains" title="Permalink to this definition">¶</a><br /></dt>
  252. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Determine if <em>o</em> contains <em>value</em>. If an item in <em>o</em> is equal to <em>value</em>,
  253. return <code class="docutils literal notranslate"><span class="pre">1</span></code>, otherwise return <code class="docutils literal notranslate"><span class="pre">0</span></code>. On error, return <code class="docutils literal notranslate"><span class="pre">-1</span></code>. This is
  254. equivalent to the Python expression <code class="docutils literal notranslate"><span class="pre">value</span> <span class="pre">in</span> <span class="pre">o</span></code>.</p>
  255. </dd></dl>
  256. <dl class="c function">
  257. <dt class="sig sig-object c" id="c.PySequence_Index">
  258. <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Index</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Index" title="Permalink to this definition">¶</a><br /></dt>
  259. <dd><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the first index <em>i</em> for which <code class="docutils literal notranslate"><span class="pre">o[i]</span> <span class="pre">==</span> <span class="pre">value</span></code>. On error, return
  260. <code class="docutils literal notranslate"><span class="pre">-1</span></code>. This is equivalent to the Python expression <code class="docutils literal notranslate"><span class="pre">o.index(value)</span></code>.</p>
  261. </dd></dl>
  262. <dl class="c function">
  263. <dt class="sig sig-object c" id="c.PySequence_List">
  264. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_List</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_List" title="Permalink to this definition">¶</a><br /></dt>
  265. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return a list object with the same contents as the sequence or iterable <em>o</em>,
  266. or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure. The returned list is guaranteed to be new. This is
  267. equivalent to the Python expression <code class="docutils literal notranslate"><span class="pre">list(o)</span></code>.</p>
  268. </dd></dl>
  269. <dl class="c function">
  270. <dt class="sig sig-object c" id="c.PySequence_Tuple">
  271. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Tuple</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Tuple" title="Permalink to this definition">¶</a><br /></dt>
  272. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p id="index-1">Return a tuple object with the same contents as the sequence or iterable <em>o</em>,
  273. or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure. If <em>o</em> is a tuple, a new reference will be returned,
  274. otherwise a tuple will be constructed with the appropriate contents. This is
  275. equivalent to the Python expression <code class="docutils literal notranslate"><span class="pre">tuple(o)</span></code>.</p>
  276. </dd></dl>
  277. <dl class="c function">
  278. <dt class="sig sig-object c" id="c.PySequence_Fast">
  279. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Fast</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">char</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">m</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Fast" title="Permalink to this definition">¶</a><br /></dt>
  280. <dd><em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable.html#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return the sequence or iterable <em>o</em> as an object usable by the other
  281. <code class="docutils literal notranslate"><span class="pre">PySequence_Fast*</span></code> family of functions. If the object is not a sequence or
  282. iterable, raises <a class="reference internal" href="../library/exceptions.html#TypeError" title="TypeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a> with <em>m</em> as the message text. Returns
  283. <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure.</p>
  284. <p>The <code class="docutils literal notranslate"><span class="pre">PySequence_Fast*</span></code> functions are thus named because they assume
  285. <em>o</em> is a <a class="reference internal" href="tuple.html#c.PyTupleObject" title="PyTupleObject"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyTupleObject</span></code></a> or a <a class="reference internal" href="list.html#c.PyListObject" title="PyListObject"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyListObject</span></code></a> and access
  286. the data fields of <em>o</em> directly.</p>
  287. <p>As a CPython implementation detail, if <em>o</em> is already a sequence or list, it
  288. will be returned.</p>
  289. </dd></dl>
  290. <dl class="c function">
  291. <dt class="sig sig-object c" id="c.PySequence_Fast_GET_SIZE">
  292. <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Fast_GET_SIZE</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Fast_GET_SIZE" title="Permalink to this definition">¶</a><br /></dt>
  293. <dd><p>Returns the length of <em>o</em>, assuming that <em>o</em> was returned by
  294. <a class="reference internal" href="#c.PySequence_Fast" title="PySequence_Fast"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_Fast()</span></code></a> and that <em>o</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>. The size can also be
  295. retrieved by calling <a class="reference internal" href="#c.PySequence_Size" title="PySequence_Size"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_Size()</span></code></a> on <em>o</em>, but
  296. <a class="reference internal" href="#c.PySequence_Fast_GET_SIZE" title="PySequence_Fast_GET_SIZE"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_Fast_GET_SIZE()</span></code></a> is faster because it can assume <em>o</em> is a
  297. list or tuple.</p>
  298. </dd></dl>
  299. <dl class="c function">
  300. <dt class="sig sig-object c" id="c.PySequence_Fast_GET_ITEM">
  301. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Fast_GET_ITEM</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Fast_GET_ITEM" title="Permalink to this definition">¶</a><br /></dt>
  302. <dd><em class="refcount">Return value: Borrowed reference.</em><p>Return the <em>i</em>th element of <em>o</em>, assuming that <em>o</em> was returned by
  303. <a class="reference internal" href="#c.PySequence_Fast" title="PySequence_Fast"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_Fast()</span></code></a>, <em>o</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>, and that <em>i</em> is within bounds.</p>
  304. </dd></dl>
  305. <dl class="c function">
  306. <dt class="sig sig-object c" id="c.PySequence_Fast_ITEMS">
  307. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_Fast_ITEMS</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_Fast_ITEMS" title="Permalink to this definition">¶</a><br /></dt>
  308. <dd><p>Return the underlying array of PyObject pointers. Assumes that <em>o</em> was returned
  309. by <a class="reference internal" href="#c.PySequence_Fast" title="PySequence_Fast"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_Fast()</span></code></a> and <em>o</em> is not <code class="docutils literal notranslate"><span class="pre">NULL</span></code>.</p>
  310. <p>Note, if a list gets resized, the reallocation may relocate the items array.
  311. So, only use the underlying array pointer in contexts where the sequence
  312. cannot change.</p>
  313. </dd></dl>
  314. <dl class="c function">
  315. <dt class="sig sig-object c" id="c.PySequence_ITEM">
  316. <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">PySequence_ITEM</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><span class="n"><span class="pre">PyObject</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n"><span class="pre">o</span></span>, <a class="reference internal" href="intro.html#c.Py_ssize_t" title="Py_ssize_t"><span class="n"><span class="pre">Py_ssize_t</span></span></a><span class="w"> </span><span class="n"><span class="pre">i</span></span><span class="sig-paren">)</span><a class="headerlink" href="#c.PySequence_ITEM" title="Permalink to this definition">¶</a><br /></dt>
  317. <dd><em class="refcount">Return value: New reference.</em><p>Return the <em>i</em>th element of <em>o</em> or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> on failure. Faster form of
  318. <a class="reference internal" href="#c.PySequence_GetItem" title="PySequence_GetItem"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_GetItem()</span></code></a> but without checking that
  319. <a class="reference internal" href="#c.PySequence_Check" title="PySequence_Check"><code class="xref c c-func docutils literal notranslate"><span class="pre">PySequence_Check()</span></code></a> on <em>o</em> is true and without adjustment for negative
  320. indices.</p>
  321. </dd></dl>
  322. </section>
  323. <div class="clearer"></div>
  324. </div>
  325. </div>
  326. </div>
  327. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  328. <div class="sphinxsidebarwrapper">
  329. <div>
  330. <h4>Previous topic</h4>
  331. <p class="topless"><a href="number.html"
  332. title="previous chapter">Number Protocol</a></p>
  333. </div>
  334. <div>
  335. <h4>Next topic</h4>
  336. <p class="topless"><a href="mapping.html"
  337. title="next chapter">Mapping Protocol</a></p>
  338. </div>
  339. <div role="note" aria-label="source link">
  340. <h3>This Page</h3>
  341. <ul class="this-page-menu">
  342. <li><a href="../bugs.html">Report a Bug</a></li>
  343. <li>
  344. <a href="https://github.com/python/cpython/blob/main/Doc/c-api/sequence.rst"
  345. rel="nofollow">Show Source
  346. </a>
  347. </li>
  348. </ul>
  349. </div>
  350. </div>
  351. </div>
  352. <div class="clearer"></div>
  353. </div>
  354. <div class="related" role="navigation" aria-label="related navigation">
  355. <h3>Navigation</h3>
  356. <ul>
  357. <li class="right" style="margin-right: 10px">
  358. <a href="../genindex.html" title="General Index"
  359. >index</a></li>
  360. <li class="right" >
  361. <a href="../py-modindex.html" title="Python Module Index"
  362. >modules</a> |</li>
  363. <li class="right" >
  364. <a href="mapping.html" title="Mapping Protocol"
  365. >next</a> |</li>
  366. <li class="right" >
  367. <a href="number.html" title="Number Protocol"
  368. >previous</a> |</li>
  369. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  370. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  371. <li class="switchers">
  372. <div class="language_switcher_placeholder"></div>
  373. <div class="version_switcher_placeholder"></div>
  374. </li>
  375. <li>
  376. </li>
  377. <li id="cpython-language-and-version">
  378. <a href="../index.html">3.12.0 Documentation</a> &#187;
  379. </li>
  380. <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &#187;</li>
  381. <li class="nav-item nav-item-2"><a href="abstract.html" >Abstract Objects Layer</a> &#187;</li>
  382. <li class="nav-item nav-item-this"><a href="">Sequence Protocol</a></li>
  383. <li class="right">
  384. <div class="inline-search" role="search">
  385. <form class="inline-search" action="../search.html" method="get">
  386. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  387. <input type="submit" value="Go" />
  388. </form>
  389. </div>
  390. |
  391. </li>
  392. <li class="right">
  393. <label class="theme-selector-label">
  394. Theme
  395. <select class="theme-selector" oninput="activateTheme(this.value)">
  396. <option value="auto" selected>Auto</option>
  397. <option value="light">Light</option>
  398. <option value="dark">Dark</option>
  399. </select>
  400. </label> |</li>
  401. </ul>
  402. </div>
  403. <div class="footer">
  404. &copy; <a href="../copyright.html">Copyright</a> 2001-2023, Python Software Foundation.
  405. <br />
  406. This page is licensed under the Python Software Foundation License Version 2.
  407. <br />
  408. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  409. <br />
  410. See <a href="/license.html">History and License</a> for more information.<br />
  411. <br />
  412. The Python Software Foundation is a non-profit corporation.
  413. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  414. <br />
  415. <br />
  416. Last updated on Oct 02, 2023.
  417. <a href="/bugs.html">Found a bug</a>?
  418. <br />
  419. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
  420. </div>
  421. </body>
  422. </html>