CINXE.COM

Glossary — typing documentation

<!DOCTYPE html> <html lang="en" data-content_root="../"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Glossary &#8212; typing documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" /> <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=23252803" /> <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=5349f25f" /> <script src="../_static/documentation_options.js?v=5929fcd5"></script> <script src="../_static/doctools.js?v=888ff710"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="prev" title="Historical and deprecated features" href="historical.html" /><link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css"> <link rel="shortcut icon" type="image/png" href="../_static/py.svg" /> <script type="text/javascript" src="../_static/copybutton.js"></script> <script type="text/javascript" src="../_static/menu.js"></script> <script type="text/javascript" src="../_static/search-focus.js"></script> <script type="text/javascript" src="../_static/themetoggle.js"></script> <script async type="text/javascript" src="/_/static/javascript/readthedocs-addons.js"></script><meta name="readthedocs-project-slug" content="typing" /><meta name="readthedocs-version-slug" content="latest" /><meta name="readthedocs-resolver-filename" content="/spec/glossary.html" /><meta name="readthedocs-http-status" content="200" /></head> <body> <div class="mobile-nav"> <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation" aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" /> <nav class="nav-content" role="navigation"> <label for="menuToggler" class="toggler__label"> <span></span> </label> <span class="nav-items-wrapper"> <a href="https://www.python.org/" class="nav-logo"> <img src="../_static/py.svg" alt="Python logo"/> </a> <span class="version_switcher_placeholder"></span> <form role="search" class="search" action="../search.html" method="get"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon"> <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> </svg> <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" /> <input type="submit" value="Go"/> </form> </span> </nav> <div class="menu-wrapper"> <nav class="menu" role="navigation" aria-label="main navigation"> <div class="language_switcher_placeholder"></div> <label class="theme-selector-label"> Theme <select class="theme-selector" oninput="activateTheme(this.value)"> <option value="auto" selected>Auto</option> <option value="light">Light</option> <option value="dark">Dark</option> </select> </label> <div> <h4>Previous topic</h4> <p class="topless"><a href="historical.html" title="previous chapter">Historical and deprecated features</a></p> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/spec/glossary.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>document.getElementById('searchbox').style.display = "block"</script> </nav> </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" accesskey="I">index</a></li> <li class="right" > <a href="historical.html" title="Historical and deprecated features" accesskey="P">previous</a> |</li> <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> &#187;</li> <li class="switchers"> <div class="language_switcher_placeholder"></div> <div class="version_switcher_placeholder"></div> </li> <li> <a href="../index.html">typing documentation</a> &#187; </li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Specification for the Python type system</a> &#187;</li> <li class="nav-item nav-item-this"><a href="">Glossary</a></li> <li class="right"> <div class="inline-search" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" /> <input type="submit" value="Go" /> </form> </div> | </li> <li class="right"> <label class="theme-selector-label"> Theme <select class="theme-selector" oninput="activateTheme(this.value)"> <option value="auto" selected>Auto</option> <option value="light">Light</option> <option value="dark">Dark</option> </select> </label> |</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="glossary"> <span id="id1"></span><h1>Glossary<a class="headerlink" href="#glossary" title="Link to this heading">¶</a></h1> <p>This section defines a few terms that may be used elsewhere in the specification.</p> <dl class="simple glossary"> <dt id="term-annotation-expression">annotation expression<a class="headerlink" href="#term-annotation-expression" title="Link to this term">¶</a></dt><dd><p>An expression that is valid to use within an annotation. This is usually a <a class="reference internal" href="#term-type-expression"><span class="xref std std-term">type expression</span></a>, sometimes with additional <a class="reference internal" href="#term-type-qualifier"><span class="xref std std-term">type qualifiers</span></a>. See <a class="reference internal" href="annotations.html#annotation-expression"><span class="std std-ref">“Type and annotation expression”</span></a> for details.</p> </dd> <dt id="term-assignable">assignable<a class="headerlink" href="#term-assignable" title="Link to this term">¶</a></dt><dd><p>If a type <code class="docutils literal notranslate"><span class="pre">B</span></code> is “assignable to” a type <code class="docutils literal notranslate"><span class="pre">A</span></code>, a type checker should not error on the assignment <code class="docutils literal notranslate"><span class="pre">x:</span> <span class="pre">A</span> <span class="pre">=</span> <span class="pre">b</span></code>, where <code class="docutils literal notranslate"><span class="pre">b</span></code> is some expression whose type is <code class="docutils literal notranslate"><span class="pre">B</span></code>. Similarly for function calls and returns: <code class="docutils literal notranslate"><span class="pre">f(b)</span></code> where <code class="docutils literal notranslate"><span class="pre">def</span> <span class="pre">f(x:</span> <span class="pre">A):</span> <span class="pre">...</span></code> and <code class="docutils literal notranslate"><span class="pre">return</span> <span class="pre">b</span></code> inside <code class="docutils literal notranslate"><span class="pre">def</span> <span class="pre">f(...)</span> <span class="pre">-&gt;</span> <span class="pre">A:</span> <span class="pre">...</span></code> are both valid (not type errors) if and only if <code class="docutils literal notranslate"><span class="pre">B</span></code> is assignable to <code class="docutils literal notranslate"><span class="pre">A</span></code>. In this case <code class="docutils literal notranslate"><span class="pre">A</span></code> is “assignable from” <code class="docutils literal notranslate"><span class="pre">B</span></code>. For <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static types</span></a>, “assignable to” is equivalent to “<a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> of” and “assignable from” is equivalent to “<a class="reference internal" href="#term-supertype"><span class="xref std std-term">supertype</span></a> of”. For <a class="reference internal" href="#term-gradual-type"><span class="xref std std-term">gradual types</span></a>, a type <code class="docutils literal notranslate"><span class="pre">B</span></code> is assignable to a type <code class="docutils literal notranslate"><span class="pre">A</span></code> if there exist fully static <a class="reference internal" href="#term-materialize"><span class="xref std std-term">materializations</span></a> <code class="docutils literal notranslate"><span class="pre">A'</span></code> and <code class="docutils literal notranslate"><span class="pre">B'</span></code> of <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code>, respectively, such that <code class="docutils literal notranslate"><span class="pre">B'</span></code> is a subtype of <code class="docutils literal notranslate"><span class="pre">A'</span></code>. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-consistent">consistent<a class="headerlink" href="#term-consistent" title="Link to this term">¶</a></dt><dd><p>Two <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static types</span></a> are “consistent with” each other if they are <a class="reference internal" href="#term-equivalent"><span class="xref std std-term">equivalent</span></a>. Two gradual types are “consistent with” each other if they could <a class="reference internal" href="#term-materialize"><span class="xref std std-term">materialize</span></a> to the same type. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>. If two types are consistent, they are both <a class="reference internal" href="#term-assignable"><span class="xref std std-term">assignable</span></a> to and from each other.</p> </dd> <dt id="term-consistent-subtype">consistent subtype<a class="headerlink" href="#term-consistent-subtype" title="Link to this term">¶</a></dt><dd><p>“Consistent subtype” is synonymous with “<a class="reference internal" href="#term-assignable"><span class="xref std std-term">assignable</span></a> to” (and “consistent supertype” is synonymous with “assignable from”). See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-distribution">distribution<a class="headerlink" href="#term-distribution" title="Link to this term">¶</a></dt><dd><p>The packaged file which is used to publish and distribute a release. (<span class="target" id="index-0"></span><a class="pep reference external" href="https://peps.python.org/pep-0426/"><strong>PEP 426</strong></a>)</p> </dd> <dt id="term-equivalent">equivalent<a class="headerlink" href="#term-equivalent" title="Link to this term">¶</a></dt><dd><p>Two <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static types</span></a> <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> are equivalent if <code class="docutils literal notranslate"><span class="pre">A</span></code> is a <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> of <code class="docutils literal notranslate"><span class="pre">B</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> is a <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> of <code class="docutils literal notranslate"><span class="pre">A</span></code>. This implies that <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> represent the same set of possible runtime objects. Two gradual types <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> are equivalent if all <a class="reference internal" href="#term-materialize"><span class="xref std std-term">materializations</span></a> of <code class="docutils literal notranslate"><span class="pre">A</span></code> are also materializations of <code class="docutils literal notranslate"><span class="pre">B</span></code>, and all materializations of <code class="docutils literal notranslate"><span class="pre">B</span></code> are also materializations of <code class="docutils literal notranslate"><span class="pre">A</span></code>.</p> </dd> <dt id="term-fully-static-type">fully static type<a class="headerlink" href="#term-fully-static-type" title="Link to this term">¶</a></dt><dd><p>A type is “fully static” if it does not contain any <a class="reference internal" href="#term-gradual-form"><span class="xref std std-term">gradual form</span></a>. A fully static type represents a set of possible runtime values. Fully static types participate in the <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> relation. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-gradual-form">gradual form<a class="headerlink" href="#term-gradual-form" title="Link to this term">¶</a></dt><dd><p>A gradual form is an element of a <a class="reference internal" href="#term-type-expression"><span class="xref std std-term">type expression</span></a> which makes the type it is part of not a <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a>, but rather a representation of a set of possible static types. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>. The primary gradual form is <a class="reference internal" href="special-types.html#any"><span class="std std-ref">Any</span></a>. The ellipsis (<code class="docutils literal notranslate"><span class="pre">...</span></code>) is a gradual form in some, but not all, contexts. It is a gradual form when used in a <a class="reference internal" href="callables.html#callable"><span class="std std-ref">Callable</span></a> type, and when used in <code class="docutils literal notranslate"><span class="pre">tuple[Any,</span> <span class="pre">...]</span></code> (but not in other <a class="reference internal" href="tuples.html#tuples"><span class="std std-ref">tuple</span></a> types).</p> </dd> <dt id="term-gradual-type">gradual type<a class="headerlink" href="#term-gradual-type" title="Link to this term">¶</a></dt><dd><p>All types in the Python type system are “gradual”. A gradual type may be a <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a>, or it may be <a class="reference internal" href="special-types.html#any"><span class="std std-ref">Any</span></a>, or a type that contains <code class="docutils literal notranslate"><span class="pre">Any</span></code> or another <a class="reference internal" href="#term-gradual-form"><span class="xref std std-term">gradual form</span></a>. A gradual type does not necessarily represent a single set of possible runtime values; instead it can represent a set of possible static types (a set of possible sets of possible runtime values). Gradual types which are not fully static do not participate in the <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> relation, but they do participate in <a class="reference internal" href="#term-consistent"><span class="xref std std-term">consistency</span></a> and <a class="reference internal" href="#term-assignable"><span class="xref std std-term">assignability</span></a>. They can be <a class="reference internal" href="#term-materialize"><span class="xref std std-term">materialized</span></a> to a more static, or fully static, type. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-inline">inline<a class="headerlink" href="#term-inline" title="Link to this term">¶</a></dt><dd><p>Inline type annotations are annotations that are included in the runtime code using <span class="target" id="index-1"></span><a class="pep reference external" href="https://peps.python.org/pep-0526/"><strong>PEP 526</strong></a> and <span class="target" id="index-2"></span><a class="pep reference external" href="https://peps.python.org/pep-3107/"><strong>PEP 3107</strong></a> syntax (the filename ends in <code class="docutils literal notranslate"><span class="pre">.py</span></code>).</p> </dd> <dt id="term-materialize">materialize<a class="headerlink" href="#term-materialize" title="Link to this term">¶</a></dt><dd><p>A <a class="reference internal" href="#term-gradual-type"><span class="xref std std-term">gradual type</span></a> can be materialized to a more static type (possibly a <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a>) by replacing <a class="reference internal" href="special-types.html#any"><span class="std std-ref">Any</span></a> with any other type, or by replacing the <cite>…</cite> in a <a class="reference internal" href="callables.html#callable"><span class="std std-ref">Callable</span></a> type with a list of types, or by replacing <code class="docutils literal notranslate"><span class="pre">tuple[Any,</span> <span class="pre">...]</span></code> with a specific-length tuple type. This materialization relation is key to defining <a class="reference internal" href="#term-assignable"><span class="xref std std-term">assignability</span></a> for gradual types. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-module">module<a class="headerlink" href="#term-module" title="Link to this term">¶</a></dt><dd><p>A file containing Python runtime code or stubbed type information.</p> </dd> <dt id="term-narrow">narrow<a class="headerlink" href="#term-narrow" title="Link to this term">¶</a></dt><dd><p>A <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a> <code class="docutils literal notranslate"><span class="pre">B</span></code> is narrower than a fully static type <code class="docutils literal notranslate"><span class="pre">A</span></code> if <code class="docutils literal notranslate"><span class="pre">B</span></code> is a <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> of <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> is not <a class="reference internal" href="#term-equivalent"><span class="xref std std-term">equivalent</span></a> to <code class="docutils literal notranslate"><span class="pre">A</span></code>. This means that <code class="docutils literal notranslate"><span class="pre">B</span></code> represents a proper subset of the possible objects represented by <code class="docutils literal notranslate"><span class="pre">A</span></code>. “Type narrowing” is when a type checker infers that a name or expression must have a narrower type at some locations in control flow, due to an assignment or a runtime check of its value.</p> </dd> <dt id="term-nominal">nominal<a class="headerlink" href="#term-nominal" title="Link to this term">¶</a></dt><dd><p>A nominal type (e.g. a class name) represents the set of values whose <code class="docutils literal notranslate"><span class="pre">__class__</span></code> is that type, or any of its subclasses, transitively. In contrast, see <a class="reference internal" href="#term-structural"><span class="xref std std-term">structural</span></a> types.</p> </dd> <dt id="term-package">package<a class="headerlink" href="#term-package" title="Link to this term">¶</a></dt><dd><p>A directory or directories that namespace Python modules. (Note the distinction between packages and <a class="reference internal" href="#term-distribution"><span class="xref std std-term">distributions</span></a>. While most distributions are named after the one package they install, some distributions install multiple packages.)</p> </dd> <dt id="term-special-form">special form<a class="headerlink" href="#term-special-form" title="Link to this term">¶</a></dt><dd><p>A special form is an object that has a special meaning within the type system, comparable to a keyword in the language grammar. Examples include <code class="docutils literal notranslate"><span class="pre">Any</span></code>, <code class="docutils literal notranslate"><span class="pre">Generic</span></code>, <code class="docutils literal notranslate"><span class="pre">Literal</span></code>, and <code class="docutils literal notranslate"><span class="pre">TypedDict</span></code>. Special forms can often but not always be used within <a class="reference internal" href="annotations.html#type-expression"><span class="std std-ref">type expressions</span></a>. Special forms can usually be imported from the <a class="reference external" href="https://docs.python.org/3/library/typing.html#module-typing" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">typing</span></code></a> module or equivalently from <code class="docutils literal notranslate"><span class="pre">typing_extensions</span></code>, but some special forms are placed in other modules.</p> </dd> <dt id="term-structural">structural<a class="headerlink" href="#term-structural" title="Link to this term">¶</a></dt><dd><p>A structural type (see e.g. <a class="reference internal" href="protocol.html#protocols"><span class="std std-ref">Protocols</span></a>, <a class="reference internal" href="typeddict.html#typeddict"><span class="std std-ref">TypedDict</span></a>) defines a set of values not by their <code class="docutils literal notranslate"><span class="pre">__class__</span></code>, but by their properties (e.g. attributes, methods, dictionary key/value types). <a class="reference internal" href="callables.html#callable"><span class="std std-ref">Callable</span></a> types are also structural; a callable type is a subtype of another callable type based on their signatures, not a subclass relationship. In contrast, see <a class="reference internal" href="#term-nominal"><span class="xref std std-term">nominal</span></a> types.</p> </dd> <dt id="term-stub">stub<a class="headerlink" href="#term-stub" title="Link to this term">¶</a></dt><dd><p>A file containing only type information, empty of runtime code (the filename ends in <code class="docutils literal notranslate"><span class="pre">.pyi</span></code>). See <a class="reference internal" href="distributing.html#stub-files"><span class="std std-ref">Stub files</span></a>.</p> </dd> <dt id="term-subtype">subtype<a class="headerlink" href="#term-subtype" title="Link to this term">¶</a></dt><dd><p>A <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a> <code class="docutils literal notranslate"><span class="pre">B</span></code> is a subtype of a fully static type <code class="docutils literal notranslate"><span class="pre">A</span></code> if and only if the set of possible runtime values represented by <code class="docutils literal notranslate"><span class="pre">B</span></code> is a subset of the set of possible runtime values represented by <code class="docutils literal notranslate"><span class="pre">A</span></code>. For <a class="reference internal" href="#term-nominal"><span class="xref std std-term">nominal</span></a> types (classes), subtyping is defined by inheritance. For <a class="reference internal" href="#term-structural"><span class="xref std std-term">structural</span></a> types, subtyping is defined by a shared set of attributes/methods or keys. Subtype is the inverse of <a class="reference internal" href="#term-supertype"><span class="xref std std-term">supertype</span></a>. A type that is not fully static is not a subtype or supertype of any other type, but via <a class="reference internal" href="#term-materialize"><span class="xref std std-term">materialization</span></a> can be <a class="reference internal" href="#term-assignable"><span class="xref std std-term">assignable</span></a> to another type. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-supertype">supertype<a class="headerlink" href="#term-supertype" title="Link to this term">¶</a></dt><dd><p>A <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a> <code class="docutils literal notranslate"><span class="pre">A</span></code> is a supertype of a fully static type <code class="docutils literal notranslate"><span class="pre">B</span></code> if and only if the set of possible runtime values represented by <code class="docutils literal notranslate"><span class="pre">A</span></code> is a superset of the set of possible runtime values represented by <code class="docutils literal notranslate"><span class="pre">B</span></code>. Supertype is the inverse of <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a>. See <a class="reference internal" href="concepts.html#type-system-concepts"><span class="std std-ref">Type system concepts</span></a>.</p> </dd> <dt id="term-type-expression">type expression<a class="headerlink" href="#term-type-expression" title="Link to this term">¶</a></dt><dd><p>An expression that represents a type. The type system requires the use of type expressions within <a class="reference internal" href="#term-annotation-expression"><span class="xref std std-term">annotation expression</span></a> and also in several other contexts. See <a class="reference internal" href="annotations.html#type-expression"><span class="std std-ref">“Type and annotation expression”</span></a> for details.</p> </dd> <dt id="term-type-qualifier">type qualifier<a class="headerlink" href="#term-type-qualifier" title="Link to this term">¶</a></dt><dd><p>A type qualifier is a <a class="reference internal" href="#term-special-form"><span class="xref std std-term">special form</span></a> that qualifies a <a class="reference internal" href="#term-type-expression"><span class="xref std std-term">type expression</span></a> to form an <a class="reference internal" href="#term-annotation-expression"><span class="xref std std-term">annotation expression</span></a>. For example, the type qualifier <a class="reference internal" href="qualifiers.html#uppercase-final"><span class="std std-ref">Final</span></a> can be used around a type to indicate that the annotated value may not be overridden or modified. This term is also used for other special forms that modify a type, but using a different syntactic context, such as the <a class="reference internal" href="qualifiers.html#at-final"><span class="std std-ref">&#64;final</span></a> decorator.</p> </dd> <dt id="term-wide">wide<a class="headerlink" href="#term-wide" title="Link to this term">¶</a></dt><dd><p>A <a class="reference internal" href="#term-fully-static-type"><span class="xref std std-term">fully static type</span></a> <code class="docutils literal notranslate"><span class="pre">A</span></code> is wider than a fully static type <code class="docutils literal notranslate"><span class="pre">B</span></code> if and only if <code class="docutils literal notranslate"><span class="pre">B</span></code> is a <a class="reference internal" href="#term-subtype"><span class="xref std std-term">subtype</span></a> of <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> is not <a class="reference internal" href="#term-equivalent"><span class="xref std std-term">equivalent</span></a> to <code class="docutils literal notranslate"><span class="pre">A</span></code>. This means that <code class="docutils literal notranslate"><span class="pre">A</span></code> represents a proper superset of the possible values represented by <code class="docutils literal notranslate"><span class="pre">B</span></code>. See also “<a class="reference internal" href="#term-narrow"><span class="xref std std-term">narrow</span></a>”.</p> </dd> </dl> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <div> <h4>Previous topic</h4> <p class="topless"><a href="historical.html" title="previous chapter">Historical and deprecated features</a></p> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/spec/glossary.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>document.getElementById('searchbox').style.display = "block"</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="historical.html" title="Historical and deprecated features" >previous</a> |</li> <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> &#187;</li> <li class="switchers"> <div class="language_switcher_placeholder"></div> <div class="version_switcher_placeholder"></div> </li> <li> <a href="../index.html">typing documentation</a> &#187; </li> <li class="nav-item nav-item-1"><a href="index.html" >Specification for the Python type system</a> &#187;</li> <li class="nav-item nav-item-this"><a href="">Glossary</a></li> <li class="right"> <div class="inline-search" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" /> <input type="submit" value="Go" /> </form> </div> | </li> <li class="right"> <label class="theme-selector-label"> Theme <select class="theme-selector" oninput="activateTheme(this.value)"> <option value="auto" selected>Auto</option> <option value="light">Light</option> <option value="dark">Dark</option> </select> </label> |</li> </ul> </div> <div class="footer"> &copy; Copyright 2021, The Python Typing Team. <br /> This page is licensed under the Python Software Foundation License Version 2. <br /> Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. <br /> <br /> The Python Software Foundation is a non-profit corporation. <a href="https://www.python.org/psf/donations/">Please donate.</a> <br /> <br /> <br /> Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6. </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10