chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0822975a-7674-4fd5-923c-d3bc0f93fea3 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,834 | supabase-export-v2 | e5876e14cd1515a4 | End the scope of a prefix-URI mapping.
See :meth:`startPrefixMapping` for details. This event will always occur after
the corresponding :meth:`endElement` event, but the order of
:meth:`endPrefixMapping` events is not otherwise guaranteed. | trusted_official_docs | CPython Docs | End the scope of a prefix-URI mapping.
See :meth:`startPrefixMapping` for details. This event will always occur after
the corresponding :meth:`endElement` event, but the order of
:meth:`endPrefixMapping` events is not otherwise guaranteed. | End the scope of a prefix-URI mapping.
See :meth:`startPrefixMapping` for details. This event will always occur after
the corresponding :meth:`endElement` event, but the order of
:meth:`endPrefixMapping` events is not otherwise guaranteed. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f2a2528-e7e2-4b0b-ad44-502dc0440af8 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,829 | supabase-export-v2 | 8b87c8800b82ee1d | for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the ``feature_namespaces`` feature is enabled (the default).
There are cases, however, when applications need to use prefixes in character
data or in attribute values, where they cannot safely b... | trusted_official_docs | CPython Docs | for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the ``feature_namespaces`` feature is enabled (the default).
There are cases, however, when applications need to use prefixes in character
data or in attribute values, where they cannot safely b... | for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the ``feature_namespaces`` feature is enabled (the default).
There are cases, however, when applications need to use prefixes in character
data or in attribute values, where they cannot safely b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24e7dac3-9fb5-4175-a76b-c3a004152cc7 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,776 | supabase-export-v2 | 1e3b038389b1ce70 | --------------
The SAX API defines five kinds of handlers: content handlers, DTD handlers,
error handlers, entity resolvers and lexical handlers. Applications normally
only need to implement those interfaces whose events they are interested in;
they can implement the interfaces in a single object or in multiple objects... | trusted_official_docs | CPython Docs | --------------
The SAX API defines five kinds of handlers: content handlers, DTD handlers,
error handlers, entity resolvers and lexical handlers. Applications normally
only need to implement those interfaces whose events they are interested in;
they can implement the interfaces in a single object or in multiple objects... | --------------
The SAX API defines five kinds of handlers: content handlers, DTD handlers,
error handlers, entity resolvers and lexical handlers. Applications normally
only need to implement those interfaces whose events they are interested in;
they can implement the interfaces in a single object or in multiple objects... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24fb7e88-4e3f-48fe-b913-728cc97f30b7 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,807 | supabase-export-v2 | 3f4af38f99f9ad06 | .. data:: property_dom_node
| value: ``"http://xml.org/sax/properties/dom-node"``
| data type: org.w3c.dom.Node (not supported in Python 2)
| description: When parsing, the current DOM node being visited if this is
a DOM iterator; when not parsing, the root DOM node for iteration. | access: (parsing) read-only; (not... | trusted_official_docs | CPython Docs | .. data:: property_dom_node
| value: ``"http://xml.org/sax/properties/dom-node"``
| data type: org.w3c.dom.Node (not supported in Python 2)
| description: When parsing, the current DOM node being visited if this is
a DOM iterator; when not parsing, the root DOM node for iteration. | access: (parsing) read-only; (not... | .. data:: property_dom_node
| value: ``"http://xml.org/sax/properties/dom-node"``
| data type: org.w3c.dom.Node (not supported in Python 2)
| description: When parsing, the current DOM node being visited if this is
a DOM iterator; when not parsing, the root DOM node for iteration. | access: (parsing) read-only; (not... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c7b72fe-a38b-4b27-8fdc-628ef4ed54ca | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,884 | supabase-export-v2 | 0effa80689d67fe5 | .. method:: ErrorHandler.warning(exception)
Called when the parser presents minor warning information to the application. Parsing is expected to continue when this method returns, and document
information will continue to be passed to the application. Raising an exception
in this method will cause parsing to end. | trusted_official_docs | CPython Docs | .. method:: ErrorHandler.warning(exception)
Called when the parser presents minor warning information to the application. Parsing is expected to continue when this method returns, and document
information will continue to be passed to the application. Raising an exception
in this method will cause parsing to end. | .. method:: ErrorHandler.warning(exception)
Called when the parser presents minor warning information to the application. Parsing is expected to continue when this method returns, and document
information will continue to be passed to the application. Raising an exception
in this method will cause parsing to end. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42f4e9b2-ccd3-481b-a238-47af50922cdb | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,830 | supabase-export-v2 | 5ba74f7573b63560 | cannot safely be expanded automatically; the :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events supply the information to the application to expand prefixes in those contexts itself, if necessary.
.. XXX This is not really the default, is it? MvL | trusted_official_docs | CPython Docs | cannot safely be expanded automatically; the :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events supply the information to the application to expand prefixes in those contexts itself, if necessary.
.. XXX This is not really the default, is it? MvL | cannot safely be expanded automatically; the :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events supply the information to the application to expand prefixes in those contexts itself, if necessary.
.. XXX This is not really the default, is it? MvL | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
504285ba-add1-4bca-980b-3f4997956a5a | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,887 | supabase-export-v2 | bdcb0d068edb761c | LexicalHandler Objects ---------------------- Optional SAX2 handler for lexical events.
This handler is used to obtain lexical information about an XML
document. Lexical information includes information describing the
document encoding used and XML comments embedded in the document, as
well as section boundaries for th... | trusted_official_docs | CPython Docs | LexicalHandler Objects ---------------------- Optional SAX2 handler for lexical events.
This handler is used to obtain lexical information about an XML
document. Lexical information includes information describing the
document encoding used and XML comments embedded in the document, as
well as section boundaries for th... | LexicalHandler Objects ---------------------- Optional SAX2 handler for lexical events.
This handler is used to obtain lexical information about an XML
document. Lexical information includes information describing the
document encoding used and XML comments embedded in the document, as
well as section boundaries for th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5dfea870-1c72-489c-b9df-60963e7ba448 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,798 | supabase-export-v2 | 76f55918bc4e6f76 | to `external entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_ if the parser is used with user-provided XML content. Please reflect on your `threat model <https://en.wikipedia.org/wiki/Threat_model>`_ before enabling this feature.
| value: ``"http://xml.org/sax/features/external-general-entiti... | trusted_official_docs | CPython Docs | to `external entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_ if the parser is used with user-provided XML content. Please reflect on your `threat model <https://en.wikipedia.org/wiki/Threat_model>`_ before enabling this feature.
| value: ``"http://xml.org/sax/features/external-general-entiti... | to `external entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_ if the parser is used with user-provided XML content. Please reflect on your `threat model <https://en.wikipedia.org/wiki/Threat_model>`_ before enabling this feature.
| value: ``"http://xml.org/sax/features/external-general-entiti... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6ba831ee-5c55-47f9-b5db-3c227d6dd898 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,817 | supabase-export-v2 | 4a2593b3eaa2574a | Called by the parser to give the application a locator for locating the origin of document events.
SAX parsers are strongly encouraged (though not absolutely required) to supply a
locator: if it does so, it must supply the locator to the application by
invoking this method before invoking any of the other methods in ... | trusted_official_docs | CPython Docs | Called by the parser to give the application a locator for locating the origin of document events.
SAX parsers are strongly encouraged (though not absolutely required) to supply a
locator: if it does so, it must supply the locator to the application by
invoking this method before invoking any of the other methods in ... | Called by the parser to give the application a locator for locating the origin of document events.
SAX parsers are strongly encouraged (though not absolutely required) to supply a
locator: if it does so, it must supply the locator to the application by
invoking this method before invoking any of the other methods in ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6e349dba-2822-4f14-ab4a-106c6bbd401f | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,800 | supabase-export-v2 | 70d788ccb7ed9af4 | .. data:: feature_external_pes
| value: ``"http://xml.org/sax/features/external-parameter-entities"``
| true: Include all external parameter entities, including the external DTD
subset. | false: Do not include any external parameter entities, even the external
DTD subset. | access: (parsing) read-only; (not parsing)... | trusted_official_docs | CPython Docs | .. data:: feature_external_pes
| value: ``"http://xml.org/sax/features/external-parameter-entities"``
| true: Include all external parameter entities, including the external DTD
subset. | false: Do not include any external parameter entities, even the external
DTD subset. | access: (parsing) read-only; (not parsing)... | .. data:: feature_external_pes
| value: ``"http://xml.org/sax/features/external-parameter-entities"``
| true: Include all external parameter entities, including the external DTD
subset. | false: Do not include any external parameter entities, even the external
DTD subset. | access: (parsing) read-only; (not parsing)... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7361592f-ea0c-4f7f-bee0-fa6cae903eed | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,844 | supabase-export-v2 | 786e0e729d516fa4 | a reliable way to keep a copy of the attributes. To keep a copy of the attributes, use the :meth:`copy` method of the *attrs* object.
Parsers may set the *qname* parameter to ``None``, unless the
``feature_namespace_prefixes`` feature is activated. | trusted_official_docs | CPython Docs | a reliable way to keep a copy of the attributes. To keep a copy of the attributes, use the :meth:`copy` method of the *attrs* object.
Parsers may set the *qname* parameter to ``None``, unless the
``feature_namespace_prefixes`` feature is activated. | a reliable way to keep a copy of the attributes. To keep a copy of the attributes, use the :meth:`copy` method of the *attrs* object.
Parsers may set the *qname* parameter to ``None``, unless the
``feature_namespace_prefixes`` feature is activated. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
77928d1a-73d0-4f81-881f-5f2aef1230dc | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,888 | supabase-export-v2 | 7ee8ad0da58c01ad | as well as section boundaries for the DTD and for any CDATA sections. The lexical handlers are used in the same manner as content handlers.
Set the LexicalHandler of an XMLReader by using the setProperty method
with the property identifier
``'http://xml.org/sax/properties/lexical-handler'``. | trusted_official_docs | CPython Docs | as well as section boundaries for the DTD and for any CDATA sections. The lexical handlers are used in the same manner as content handlers.
Set the LexicalHandler of an XMLReader by using the setProperty method
with the property identifier
``'http://xml.org/sax/properties/lexical-handler'``. | as well as section boundaries for the DTD and for any CDATA sections. The lexical handlers are used in the same manner as content handlers.
Set the LexicalHandler of an XMLReader by using the setProperty method
with the property identifier
``'http://xml.org/sax/properties/lexical-handler'``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7b0b15b2-c8e8-4e72-9aba-9ed7ae8e48bc | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,843 | supabase-export-v2 | f48c44f901f0b00b | Signals the start of an element in namespace mode.
The *name* parameter contains the name of the element type as a ``(uri,
localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used in
the source document, and the *attrs* parameter holds an instance of the
:ref:`AttributesNS <attributes-ns-objects>... | trusted_official_docs | CPython Docs | Signals the start of an element in namespace mode.
The *name* parameter contains the name of the element type as a ``(uri,
localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used in
the source document, and the *attrs* parameter holds an instance of the
:ref:`AttributesNS <attributes-ns-objects>... | Signals the start of an element in namespace mode.
The *name* parameter contains the name of the element type as a ``(uri,
localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used in
the source document, and the *attrs* parameter holds an instance of the
:ref:`AttributesNS <attributes-ns-objects>... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7db5e15d-c72e-470a-ad25-64c9a8ba50f7 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,784 | supabase-export-v2 | 8876dd98817bd498 | .. class:: ErrorHandler
Interface used by the parser to present error and warning messages to the
application. The methods of this object control whether errors are immediately
converted to exceptions or are handled in some other way. | trusted_official_docs | CPython Docs | .. class:: ErrorHandler
Interface used by the parser to present error and warning messages to the
application. The methods of this object control whether errors are immediately
converted to exceptions or are handled in some other way. | .. class:: ErrorHandler
Interface used by the parser to present error and warning messages to the
application. The methods of this object control whether errors are immediately
converted to exceptions or are handled in some other way. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8b2bcca5-55af-4e25-afae-590da2b309f6 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,860 | supabase-export-v2 | 7ceaef6101fe9486 | Receive notification of a processing instruction.
The Parser will invoke this method once for each processing instruction found:
note that processing instructions may occur before or after the main document
element. | trusted_official_docs | CPython Docs | Receive notification of a processing instruction.
The Parser will invoke this method once for each processing instruction found:
note that processing instructions may occur before or after the main document
element. | Receive notification of a processing instruction.
The Parser will invoke this method once for each processing instruction found:
note that processing instructions may occur before or after the main document
element. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8bbcd104-43c3-49f9-a0c1-f0d3ad8d74e9 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,791 | supabase-export-v2 | cb098949d5e603f3 | .. data:: feature_namespace_prefixes
| value: ``"http://xml.org/sax/features/namespace-prefixes"``
| true: Report the original prefixed names and attributes used for Namespace
declarations. | false: Do not report attributes used for Namespace declarations, and
optionally do not report original prefixed names (defaul... | trusted_official_docs | CPython Docs | .. data:: feature_namespace_prefixes
| value: ``"http://xml.org/sax/features/namespace-prefixes"``
| true: Report the original prefixed names and attributes used for Namespace
declarations. | false: Do not report attributes used for Namespace declarations, and
optionally do not report original prefixed names (defaul... | .. data:: feature_namespace_prefixes
| value: ``"http://xml.org/sax/features/namespace-prefixes"``
| true: Report the original prefixed names and attributes used for Namespace
declarations. | false: Do not report attributes used for Namespace declarations, and
optionally do not report original prefixed names (defaul... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
909c772a-71ce-4211-b0cd-3d65a2e5cb5a | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,856 | supabase-export-v2 | 1babacb8f55c4e88 | Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk of ignorable
whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating
parsers may also use this method if they are capable of parsing and using
content models. | trusted_official_docs | CPython Docs | Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk of ignorable
whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating
parsers may also use this method if they are capable of parsing and using
content models. | Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk of ignorable
whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating
parsers may also use this method if they are capable of parsing and using
content models. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
97deb843-95d2-4ab1-a0ac-3fead6990bbc | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,793 | supabase-export-v2 | 6c17a3a22c684f8f | .. data:: feature_string_interning
| value: ``"http://xml.org/sax/features/string-interning"``
| true: All element names, prefixes, attribute names, Namespace URIs, and
local names are interned using the built-in intern function. | false: Names are not necessarily interned, although they may be (default). | access: (... | trusted_official_docs | CPython Docs | .. data:: feature_string_interning
| value: ``"http://xml.org/sax/features/string-interning"``
| true: All element names, prefixes, attribute names, Namespace URIs, and
local names are interned using the built-in intern function. | false: Names are not necessarily interned, although they may be (default). | access: (... | .. data:: feature_string_interning
| value: ``"http://xml.org/sax/features/string-interning"``
| true: All element names, prefixes, attribute names, Namespace URIs, and
local names are interned using the built-in intern function. | false: Names are not necessarily interned, although they may be (default). | access: (... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
99dbeff7-0315-4c81-bef9-94019f409a29 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,864 | supabase-export-v2 | 90119b7121e8a300 | Receive notification of a skipped entity.
The Parser will invoke this method once for each entity skipped. Non-validating
processors may skip entities if they have not seen the declarations (because,
for example, the entity was declared in an external DTD subset). All processors
may skip external entities, depending... | trusted_official_docs | CPython Docs | Receive notification of a skipped entity.
The Parser will invoke this method once for each entity skipped. Non-validating
processors may skip entities if they have not seen the declarations (because,
for example, the entity was declared in an external DTD subset). All processors
may skip external entities, depending... | Receive notification of a skipped entity.
The Parser will invoke this method once for each entity skipped. Non-validating
processors may skip entities if they have not seen the declarations (because,
for example, the entity was declared in an external DTD subset). All processors
may skip external entities, depending... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a60c6c59-9a90-4d68-8f9b-23f7dd3f72fa | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,778 | supabase-export-v2 | 5b8d097489fc3dfd | .. class:: ContentHandler
This is the main callback interface in SAX, and the one most important to
applications. The order of events in this interface mirrors the order of the
information in the document. | trusted_official_docs | CPython Docs | .. class:: ContentHandler
This is the main callback interface in SAX, and the one most important to
applications. The order of events in this interface mirrors the order of the
information in the document. | .. class:: ContentHandler
This is the main callback interface in SAX, and the one most important to
applications. The order of events in this interface mirrors the order of the
information in the document. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b0201141-38da-4de9-9e7b-5b0a287a7f0d | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,825 | supabase-export-v2 | 97f8772e073074c1 | Receive notification of the end of a document.
The SAX parser will invoke this method only once, and it will be the last method
invoked during the parse. The parser shall not invoke this method until it has
either abandoned parsing (because of an unrecoverable error) or reached the end
of input. | trusted_official_docs | CPython Docs | Receive notification of the end of a document.
The SAX parser will invoke this method only once, and it will be the last method
invoked during the parse. The parser shall not invoke this method until it has
either abandoned parsing (because of an unrecoverable error) or reached the end
of input. | Receive notification of the end of a document.
The SAX parser will invoke this method only once, and it will be the last method
invoked during the parse. The parser shall not invoke this method until it has
either abandoned parsing (because of an unrecoverable error) or reached the end
of input. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b34b05e7-0f24-46ab-8530-485d3a270e01 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,875 | supabase-export-v2 | 38373ae73949e355 | .. method:: EntityResolver.resolveEntity(publicId, systemId)
Resolve the system identifier of an entity and return either the system
identifier to read from as a string, or an InputSource to read from. The default
implementation returns *systemId*. | trusted_official_docs | CPython Docs | .. method:: EntityResolver.resolveEntity(publicId, systemId)
Resolve the system identifier of an entity and return either the system
identifier to read from as a string, or an InputSource to read from. The default
implementation returns *systemId*. | .. method:: EntityResolver.resolveEntity(publicId, systemId)
Resolve the system identifier of an entity and return either the system
identifier to read from as a string, or an InputSource to read from. The default
implementation returns *systemId*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b45aebe7-8bed-4e54-8a25-2f6637bc3b50 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,797 | supabase-export-v2 | 61ffac5944408643 | .. warning::
Enabling opens a vulnerability to
`external entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_
if the parser is used with user-provided XML content. Please reflect on your `threat model <https://en.wikipedia.org/wiki/Threat_model>`_
before enabling this feature. | trusted_official_docs | CPython Docs | .. warning::
Enabling opens a vulnerability to
`external entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_
if the parser is used with user-provided XML content. Please reflect on your `threat model <https://en.wikipedia.org/wiki/Threat_model>`_
before enabling this feature. | .. warning::
Enabling opens a vulnerability to
`external entity attacks <https://en.wikipedia.org/wiki/XML_external_entity_attack>`_
if the parser is used with user-provided XML content. Please reflect on your `threat model <https://en.wikipedia.org/wiki/Threat_model>`_
before enabling this feature. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8a7dfcf-43a8-41b4-bf47-cf01524165b9 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,822 | supabase-export-v2 | 26bf0f4d6decb08b | Receive notification of the beginning of a document.
The SAX parser will invoke this method only once, before any other methods in
this interface or in DTDHandler (except for :meth:`setDocumentLocator`). | trusted_official_docs | CPython Docs | Receive notification of the beginning of a document.
The SAX parser will invoke this method only once, before any other methods in
this interface or in DTDHandler (except for :meth:`setDocumentLocator`). | Receive notification of the beginning of a document.
The SAX parser will invoke this method only once, before any other methods in
this interface or in DTDHandler (except for :meth:`setDocumentLocator`). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c9c6d62c-d9a3-4f58-9a8f-bcbd49753185 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,831 | supabase-export-v2 | 37e7d1cb8ca8666f | .. XXX This is not really the default, is it? MvL
Note that :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events are not
guaranteed to be properly nested relative to each-other: all
:meth:`startPrefixMapping` events will occur before the corresponding
:meth:`startElement` event, and all :meth:`endPrefixMap... | trusted_official_docs | CPython Docs | .. XXX This is not really the default, is it? MvL
Note that :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events are not
guaranteed to be properly nested relative to each-other: all
:meth:`startPrefixMapping` events will occur before the corresponding
:meth:`startElement` event, and all :meth:`endPrefixMap... | .. XXX This is not really the default, is it? MvL
Note that :meth:`startPrefixMapping` and :meth:`endPrefixMapping` events are not
guaranteed to be properly nested relative to each-other: all
:meth:`startPrefixMapping` events will occur before the corresponding
:meth:`startElement` event, and all :meth:`endPrefixMap... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca02e1d3-93ef-4fd4-a113-2142ab500089 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,805 | supabase-export-v2 | ad0fc190a9eea672 | .. data:: property_declaration_handler
| value: ``"http://xml.org/sax/properties/declaration-handler"``
| data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)
| description: An optional extension handler for DTD-related events other
than notations and unparsed entities. | access: read/write | trusted_official_docs | CPython Docs | .. data:: property_declaration_handler
| value: ``"http://xml.org/sax/properties/declaration-handler"``
| data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)
| description: An optional extension handler for DTD-related events other
than notations and unparsed entities. | access: read/write | .. data:: property_declaration_handler
| value: ``"http://xml.org/sax/properties/declaration-handler"``
| data type: xml.sax.sax2lib.DeclHandler (not supported in Python 2)
| description: An optional extension handler for DTD-related events other
than notations and unparsed entities. | access: read/write | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cef52d89-dac8-4f55-96fa-e701ac259e14 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,861 | supabase-export-v2 | b9165a35d8cc7630 | The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a
text declaration (XML 1.0, section 4.3.1) using this method. | trusted_official_docs | CPython Docs | The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a
text declaration (XML 1.0, section 4.3.1) using this method. | The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a
text declaration (XML 1.0, section 4.3.1) using this method. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d685e02e-ef8f-4269-8ae9-51bef81c9901 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,787 | supabase-export-v2 | 69d7ad91c7a6cc73 | Interface used by the parser to represent low frequency events which may not be of interest to many applications.
In addition to these classes, :mod:`!xml.sax.handler` provides symbolic constants
for the feature and property names. | trusted_official_docs | CPython Docs | Interface used by the parser to represent low frequency events which may not be of interest to many applications.
In addition to these classes, :mod:`!xml.sax.handler` provides symbolic constants
for the feature and property names. | Interface used by the parser to represent low frequency events which may not be of interest to many applications.
In addition to these classes, :mod:`!xml.sax.handler` provides symbolic constants
for the feature and property names. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d7a795f0-45e1-48ce-9f10-74e82c0713a0 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,837 | supabase-export-v2 | ce31de8e806766d3 | Signals the start of an element in non-namespace mode.
The *name* parameter contains the raw XML 1.0 name of the element type as a
string and the *attrs* parameter holds an object of the
:ref:`Attributes <attributes-objects>` interface containing the attributes of
the element. The object passed as *attrs* may be re-... | trusted_official_docs | CPython Docs | Signals the start of an element in non-namespace mode.
The *name* parameter contains the raw XML 1.0 name of the element type as a
string and the *attrs* parameter holds an object of the
:ref:`Attributes <attributes-objects>` interface containing the attributes of
the element. The object passed as *attrs* may be re-... | Signals the start of an element in non-namespace mode.
The *name* parameter contains the raw XML 1.0 name of the element type as a
string and the *attrs* parameter holds an object of the
:ref:`Attributes <attributes-objects>` interface containing the attributes of
the element. The object passed as *attrs* may be re-... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
da378a88-6400-48ed-b6c7-0bad5a0b6c5f | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,878 | supabase-export-v2 | fbd7b296816fc128 | ErrorHandler Objects --------------------
Objects with this interface are used to receive error and warning information
from the :class:`~xml.sax.xmlreader.XMLReader`. If you create an object that
implements this interface, then register the object with your
:class:`~xml.sax.xmlreader.XMLReader`, the parser
will call t... | trusted_official_docs | CPython Docs | ErrorHandler Objects --------------------
Objects with this interface are used to receive error and warning information
from the :class:`~xml.sax.xmlreader.XMLReader`. If you create an object that
implements this interface, then register the object with your
:class:`~xml.sax.xmlreader.XMLReader`, the parser
will call t... | ErrorHandler Objects --------------------
Objects with this interface are used to receive error and warning information
from the :class:`~xml.sax.xmlreader.XMLReader`. If you create an object that
implements this interface, then register the object with your
:class:`~xml.sax.xmlreader.XMLReader`, the parser
will call t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dca6b0a9-089c-4502-be9f-34429db69872 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,857 | supabase-export-v2 | a2d06a386c81e5f8 | (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace in a single chunk, or they may
split it into several chunks; however, all of the characters in any single event
... | trusted_official_docs | CPython Docs | (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace in a single chunk, or they may
split it into several chunks; however, all of the characters in any single event
... | (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace in a single chunk, or they may
split it into several chunks; however, all of the characters in any single event
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3778a57-4c19-46d4-a37b-4e54daadf5a3 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,818 | supabase-export-v2 | 03c14085fe446e37 | does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.
The locator allows the application to determine the end position of any
document-related event, even if the parser is not reporting an error. Typically,
the applica... | trusted_official_docs | CPython Docs | does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.
The locator allows the application to determine the end position of any
document-related event, even if the parser is not reporting an error. Typically,
the applica... | does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.
The locator allows the application to determine the end position of any
document-related event, even if the parser is not reporting an error. Typically,
the applica... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e9d78a66-83a9-4402-a99a-26a0cae71ae8 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,828 | supabase-export-v2 | bbd5e9599555f8ee | Begin the scope of a prefix-URI Namespace mapping.
The information from this event is not necessary for normal Namespace
processing: the SAX XML reader will automatically replace prefixes for element
and attribute names when the ``feature_namespaces`` feature is enabled (the
default). | trusted_official_docs | CPython Docs | Begin the scope of a prefix-URI Namespace mapping.
The information from this event is not necessary for normal Namespace
processing: the SAX XML reader will automatically replace prefixes for element
and attribute names when the ``feature_namespaces`` feature is enabled (the
default). | Begin the scope of a prefix-URI Namespace mapping.
The information from this event is not necessary for normal Namespace
processing: the SAX XML reader will automatically replace prefixes for element
and attribute names when the ``feature_namespaces`` feature is enabled (the
default). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ea7176a8-4795-4db9-9d45-9f39434b961c | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,850 | supabase-export-v2 | edd80f1556b32f08 | Receive notification of character data.
The Parser will call this method to report each chunk of character data. SAX
parsers may return all contiguous character data in a single chunk, or they may
split it into several chunks; however, all of the characters in any single event
must come from the same external entity... | trusted_official_docs | CPython Docs | Receive notification of character data.
The Parser will call this method to report each chunk of character data. SAX
parsers may return all contiguous character data in a single chunk, or they may
split it into several chunks; however, all of the characters in any single event
must come from the same external entity... | Receive notification of character data.
The Parser will call this method to report each chunk of character data. SAX
parsers may return all contiguous character data in a single chunk, or they may
split it into several chunks; however, all of the characters in any single event
must come from the same external entity... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb8272aa-221b-4b75-a1e2-da04bb3f5600 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,853 | supabase-export-v2 | 590243171bfc703a | .. note::
The earlier SAX 1 interface provided by the Python XML Special Interest Group
used a more Java-like interface for this method. Since most parsers used from
Python did not take advantage of the older interface, the simpler signature was
chosen to replace it. To convert old code to the new interface, use *co... | trusted_official_docs | CPython Docs | .. note::
The earlier SAX 1 interface provided by the Python XML Special Interest Group
used a more Java-like interface for this method. Since most parsers used from
Python did not take advantage of the older interface, the simpler signature was
chosen to replace it. To convert old code to the new interface, use *co... | .. note::
The earlier SAX 1 interface provided by the Python XML Special Interest Group
used a more Java-like interface for this method. Since most parsers used from
Python did not take advantage of the older interface, the simpler signature was
chosen to replace it. To convert old code to the new interface, use *co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ebbf4e57-8198-4313-8ab6-3ad03faef14d | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,819 | supabase-export-v2 | 95433b39311ce89b | content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation
of the events in this interface. The application should not attempt to use it a... | trusted_official_docs | CPython Docs | content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation
of the events in this interface. The application should not attempt to use it a... | content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation
of the events in this interface. The application should not attempt to use it a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ec4ca913-4f07-4b2a-a14e-2fd46aa2f18b | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,795 | supabase-export-v2 | 52601769c365857e | .. data:: feature_validation
| value: ``"http://xml.org/sax/features/validation"``
| true: Report all validation errors (implies external-general-entities and
external-parameter-entities). | false: Do not report validation errors. | access: (parsing) read-only; (not parsing) read/write | trusted_official_docs | CPython Docs | .. data:: feature_validation
| value: ``"http://xml.org/sax/features/validation"``
| true: Report all validation errors (implies external-general-entities and
external-parameter-entities). | false: Do not report validation errors. | access: (parsing) read-only; (not parsing) read/write | .. data:: feature_validation
| value: ``"http://xml.org/sax/features/validation"``
| true: Report all validation errors (implies external-general-entities and
external-parameter-entities). | false: Do not report validation errors. | access: (parsing) read-only; (not parsing) read/write | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee698af4-41c1-411e-b4df-91eab3f06468 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,851 | supabase-export-v2 | 50ba065402d0a9ba | several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
*content* may be a string or bytes instance; the ``expat`` reader module
always produces strings. | trusted_official_docs | CPython Docs | several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
*content* may be a string or bytes instance; the ``expat`` reader module
always produces strings. | several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
*content* may be a string or bytes instance; the ``expat`` reader module
always produces strings. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ef800dbe-d800-4ab4-95bb-2b46828c8d56 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,782 | supabase-export-v2 | 47248cded4411720 | .. class:: EntityResolver
Basic interface for resolving entities. If you create an object implementing
this interface, then register the object with your Parser, the parser will call
the method in your object to resolve all external entities. | trusted_official_docs | CPython Docs | .. class:: EntityResolver
Basic interface for resolving entities. If you create an object implementing
this interface, then register the object with your Parser, the parser will call
the method in your object to resolve all external entities. | .. class:: EntityResolver
Basic interface for resolving entities. If you create an object implementing
this interface, then register the object with your Parser, the parser will call
the method in your object to resolve all external entities. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f11e487c-7bb1-46ac-9b90-2db31b15d3a3 | CPython Docs | file://datasets/cpython/Doc/library/xml.sax.handler.rst | unknown | d58917af-83ea-4832-b3ab-4cfd2ea4839f | 28,880 | supabase-export-v2 | ac4cc03613fd00f0 | .. method:: ErrorHandler.error(exception)
Called when the parser encounters a recoverable error. If this method does not
raise an exception, parsing may continue, but further document information
should not be expected by the application. Allowing the parser to continue may
allow additional errors to be discovered i... | trusted_official_docs | CPython Docs | .. method:: ErrorHandler.error(exception)
Called when the parser encounters a recoverable error. If this method does not
raise an exception, parsing may continue, but further document information
should not be expected by the application. Allowing the parser to continue may
allow additional errors to be discovered i... | .. method:: ErrorHandler.error(exception)
Called when the parser encounters a recoverable error. If this method does not
raise an exception, parsing may continue, but further document information
should not be expected by the application. Allowing the parser to continue may
allow additional errors to be discovered i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
019dcde3-489a-4fc9-9f91-6231750faabe | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,909 | supabase-export-v2 | 927a9855a3476a46 | of low-level tools that can be used to retrieve annotations in a reliable way, even in the presence of forward references and other edge cases.
This module supports retrieving annotations in three main formats
(see :class:`Format`), each of which works best for different use cases: | trusted_official_docs | CPython Docs | of low-level tools that can be used to retrieve annotations in a reliable way, even in the presence of forward references and other edge cases.
This module supports retrieving annotations in three main formats
(see :class:`Format`), each of which works best for different use cases: | of low-level tools that can be used to retrieve annotations in a reliable way, even in the presence of forward references and other edge cases.
This module supports retrieving annotations in three main formats
(see :class:`Format`), each of which works best for different use cases: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01d56303-ff70-4ef9-b4d2-47b001dffef5 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,981 | supabase-export-v2 | 8334e8fa93f4fe2c | *obj* may be a callable, class, module, or other object with :attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes. Passing any other object raises :exc:`TypeError`.
The *format* parameter controls the format in which annotations are returned,
and must be a member of the :class:`Format` enum or it... | trusted_official_docs | CPython Docs | *obj* may be a callable, class, module, or other object with :attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes. Passing any other object raises :exc:`TypeError`.
The *format* parameter controls the format in which annotations are returned,
and must be a member of the :class:`Format` enum or it... | *obj* may be a callable, class, module, or other object with :attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes. Passing any other object raises :exc:`TypeError`.
The *format* parameter controls the format in which annotations are returned,
and must be a member of the :class:`Format` enum or it... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
02591a21-dba7-45a9-b10e-90ee56999db0 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,976 | supabase-export-v2 | f2ba3586c5f00b95 | .. function:: get_annotate_from_class_namespace(namespace)
Retrieve the :term:`annotate function` from a class namespace dictionary *namespace*. Return :const:`!None` if the namespace does not contain an annotate function. This is primarily useful before the class has been fully created (e.g., in a metaclass);
after t... | trusted_official_docs | CPython Docs | .. function:: get_annotate_from_class_namespace(namespace)
Retrieve the :term:`annotate function` from a class namespace dictionary *namespace*. Return :const:`!None` if the namespace does not contain an annotate function. This is primarily useful before the class has been fully created (e.g., in a metaclass);
after t... | .. function:: get_annotate_from_class_namespace(namespace)
Retrieve the :term:`annotate function` from a class namespace dictionary *namespace*. Return :const:`!None` if the namespace does not contain an annotate function. This is primarily useful before the class has been fully created (e.g., in a metaclass);
after t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
05ad2ae4-2b9d-407e-bedd-9c49da99f3d2 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,020 | supabase-export-v2 | 243368e670dabff7 | class Annotate: called_formats = []
def __call__(self, format=None, /, *, _self=None):
# When called with fake globals, `_self` will be the
# actual self value, and `self` will be the format. if _self is not None:
self, format = _self, self | trusted_official_docs | CPython Docs | class Annotate: called_formats = []
def __call__(self, format=None, /, *, _self=None):
# When called with fake globals, `_self` will be the
# actual self value, and `self` will be the format. if _self is not None:
self, format = _self, self | class Annotate: called_formats = []
def __call__(self, format=None, /, *, _self=None):
# When called with fake globals, `_self` will be the
# actual self value, and `self` will be the format. if _self is not None:
self, format = _self, self | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
072391ed-8b76-44cd-bb5f-751f05c6605a | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,950 | supabase-export-v2 | b8bcc715586bb45e | example, if evaluating a :class:`~ForwardRef` retrieved from an annotation found in the class namespace of a generic class ``C``, *type_params* should be set to ``C.__type_params__``.
:class:`~ForwardRef` instances returned by :func:`get_annotations`
retain references to information about the scope they originated fro... | trusted_official_docs | CPython Docs | example, if evaluating a :class:`~ForwardRef` retrieved from an annotation found in the class namespace of a generic class ``C``, *type_params* should be set to ``C.__type_params__``.
:class:`~ForwardRef` instances returned by :func:`get_annotations`
retain references to information about the scope they originated fro... | example, if evaluating a :class:`~ForwardRef` retrieved from an annotation found in the class namespace of a generic class ``C``, *type_params* should be set to ``C.__type_params__``.
:class:`~ForwardRef` instances returned by :func:`get_annotations`
retain references to information about the scope they originated fro... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0739b541-f69c-4922-842d-c461dcc94c54 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,948 | supabase-export-v2 | b2366936e4aaf9d7 | name that is not defined, evaluating it with the :attr:`~Format.FORWARDREF` format will return ``list[ForwardRef('undefined')]``. If the *format* argument is :attr:`~Format.STRING`, the method will return :attr:`~ForwardRef.__forward_arg__`.
The *owner* parameter provides the preferred mechanism for passing scope
info... | trusted_official_docs | CPython Docs | name that is not defined, evaluating it with the :attr:`~Format.FORWARDREF` format will return ``list[ForwardRef('undefined')]``. If the *format* argument is :attr:`~Format.STRING`, the method will return :attr:`~ForwardRef.__forward_arg__`.
The *owner* parameter provides the preferred mechanism for passing scope
info... | name that is not defined, evaluating it with the :attr:`~Format.FORWARDREF` format will return ``list[ForwardRef('undefined')]``. If the *format* argument is :attr:`~Format.STRING`, the method will return :attr:`~ForwardRef.__forward_arg__`.
The *owner* parameter provides the preferred mechanism for passing scope
info... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
081194a2-abb7-43c6-a21c-8c6993b5fa0b | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,945 | supabase-export-v2 | 3370d9b7c354ca50 | A string containing the code that was evaluated to produce the :class:`~ForwardRef`. The string may not be exactly equivalent to the original source.
.. method:: evaluate(*, owner=None, globals=None, locals=None, type_params=None, format=Format.VALUE) | trusted_official_docs | CPython Docs | A string containing the code that was evaluated to produce the :class:`~ForwardRef`. The string may not be exactly equivalent to the original source.
.. method:: evaluate(*, owner=None, globals=None, locals=None, type_params=None, format=Format.VALUE) | A string containing the code that was evaluated to produce the :class:`~ForwardRef`. The string may not be exactly equivalent to the original source.
.. method:: evaluate(*, owner=None, globals=None, locals=None, type_params=None, format=Format.VALUE) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
08e12bda-1588-4c4d-b965-545e975c24a0 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,927 | supabase-export-v2 | f5bd9654cb9d67c9 | is used), it will print ``{'a': 'Cls', 'return': 'None'}``. * Under deferred evaluation (Python 3.14 and later), it will print ``{'a': <class 'Cls'>, 'return': None}``.
Stock semantics were used when function annotations were first introduced
in Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious
wa... | trusted_official_docs | CPython Docs | is used), it will print ``{'a': 'Cls', 'return': 'None'}``. * Under deferred evaluation (Python 3.14 and later), it will print ``{'a': <class 'Cls'>, 'return': None}``.
Stock semantics were used when function annotations were first introduced
in Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious
wa... | is used), it will print ``{'a': 'Cls', 'return': 'None'}``. * Under deferred evaluation (Python 3.14 and later), it will print ``{'a': <class 'Cls'>, 'return': None}``.
Stock semantics were used when function annotations were first introduced
in Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious
wa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
09b7ce1b-05e7-49d0-b49d-f1f0a1c47026 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,011 | supabase-export-v2 | 9204249e3d68e48a | else: # no annotations classvars = {} wrapped_annotate = None typ = super().__new__(mcls, name, bases, ns)
if wrapped_annotate is not None:
# Wrap the original __annotate__ with a wrapper that removes ClassVars
typ.__annotate__ = wrapped_annotate
typ.classvars = classvars # Store the ClassVars in a separate attribut... | trusted_official_docs | CPython Docs | else: # no annotations classvars = {} wrapped_annotate = None typ = super().__new__(mcls, name, bases, ns)
if wrapped_annotate is not None:
# Wrap the original __annotate__ with a wrapper that removes ClassVars
typ.__annotate__ = wrapped_annotate
typ.classvars = classvars # Store the ClassVars in a separate attribut... | else: # no annotations classvars = {} wrapped_annotate = None typ = super().__new__(mcls, name, bases, ns)
if wrapped_annotate is not None:
# Wrap the original __annotate__ with a wrapper that removes ClassVars
typ.__annotate__ = wrapped_annotate
typ.classvars = classvars # Store the ClassVars in a separate attribut... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0a212810-38a7-4761-a5b8-89b88cf812a9 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,990 | supabase-export-v2 | f27847152b9b1f04 | its own annotations dict, returns an empty dict. * All accesses to object members and dict values are done using ``getattr()`` and ``dict.get()`` for safety.
*eval_str* controls whether or not values of type :class:`!str` are
replaced with the result of calling :func:`eval` on those values: | trusted_official_docs | CPython Docs | its own annotations dict, returns an empty dict. * All accesses to object members and dict values are done using ``getattr()`` and ``dict.get()`` for safety.
*eval_str* controls whether or not values of type :class:`!str` are
replaced with the result of calling :func:`eval` on those values: | its own annotations dict, returns an empty dict. * All accesses to object members and dict values are done using ``getattr()`` and ``dict.get()`` for safety.
*eval_str* controls whether or not values of type :class:`!str` are
replaced with the result of calling :func:`eval` on those values: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f33c182-4b3b-4962-a4fc-9ad08bf129a2 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,982 | supabase-export-v2 | a0c5ea8452acf399 | format in which annotations are returned, and must be a member of the :class:`Format` enum or its integer equivalent. The different formats work as follows:
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
the :attr:`!object.__annotate__` function is called if it exists. | trusted_official_docs | CPython Docs | format in which annotations are returned, and must be a member of the :class:`Format` enum or its integer equivalent. The different formats work as follows:
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
the :attr:`!object.__annotate__` function is called if it exists. | format in which annotations are returned, and must be a member of the :class:`Format` enum or its integer equivalent. The different formats work as follows:
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
the :attr:`!object.__annotate__` function is called if it exists. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0fb75f0a-ebae-409f-8023-3f3fa6b2ca9b | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,971 | supabase-export-v2 | 83ac84b0b0e254c5 | *owner* is the object that owns the evaluate function, such as the type alias or type variable object.
*format* can be used to control the format in which the value is returned: | trusted_official_docs | CPython Docs | *owner* is the object that owns the evaluate function, such as the type alias or type variable object.
*format* can be used to control the format in which the value is returned: | *owner* is the object that owns the evaluate function, such as the type alias or type variable object.
*format* can be used to control the format in which the value is returned: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16cb9573-a43b-402f-a0ac-75adf0a06d51 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,947 | supabase-export-v2 | 29863abfcf281f13 | Evaluate the forward reference, returning its value.
If the *format* argument is :attr:`~Format.VALUE` (the default),
this method may throw an exception, such as :exc:`NameError`, if the forward
reference refers to a name that cannot be resolved. The arguments to this
method can be used to provide bindings for names... | trusted_official_docs | CPython Docs | Evaluate the forward reference, returning its value.
If the *format* argument is :attr:`~Format.VALUE` (the default),
this method may throw an exception, such as :exc:`NameError`, if the forward
reference refers to a name that cannot be resolved. The arguments to this
method can be used to provide bindings for names... | Evaluate the forward reference, returning its value.
If the *format* argument is :attr:`~Format.VALUE` (the default),
this method may throw an exception, such as :exc:`NameError`, if the forward
reference refers to a name that cannot be resolved. The arguments to this
method can be used to provide bindings for names... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1a84d704-1583-4de6-9bca-f5db538b3a3a | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,013 | supabase-export-v2 | 0bfc17db1eb631f3 | Creating a custom callable annotate function ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Custom :term:`annotate functions <annotate function>` may be literal functions like those
automatically generated for functions, classes, and modules. Or, they may wish to utilise
the encapsulation provided by classes, in which ca... | trusted_official_docs | CPython Docs | Creating a custom callable annotate function ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Custom :term:`annotate functions <annotate function>` may be literal functions like those
automatically generated for functions, classes, and modules. Or, they may wish to utilise
the encapsulation provided by classes, in which ca... | Creating a custom callable annotate function ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Custom :term:`annotate functions <annotate function>` may be literal functions like those
automatically generated for functions, classes, and modules. Or, they may wish to utilise
the encapsulation provided by classes, in which ca... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1c3dd1b1-b797-4c08-b00b-b7094ebf4801 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,985 | supabase-export-v2 | 5933016ea629b8b2 | If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE`. If :attr:`~Format.VALUE` fails, the error from this call will be raised.
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
otherwise, :attr:`!object.__annotations__` is used and stringified
using :func:`an... | trusted_official_docs | CPython Docs | If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE`. If :attr:`~Format.VALUE` fails, the error from this call will be raised.
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
otherwise, :attr:`!object.__annotations__` is used and stringified
using :func:`an... | If neither of these formats are supported, it will fall back to using :attr:`~Format.VALUE`. If :attr:`~Format.VALUE` fails, the error from this call will be raised.
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
otherwise, :attr:`!object.__annotations__` is used and stringified
using :func:`an... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1dfdbb59-1b7c-44ae-95cb-965d16303625 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,934 | supabase-export-v2 | 7c13148d972f2b97 | .. attribute:: VALUE_WITH_FAKE_GLOBALS :value: 2
Special value used to signal that an annotate function is being
evaluated in a special environment with fake globals. When passed this
value, annotate functions should either return the same value as for
the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedEr... | trusted_official_docs | CPython Docs | .. attribute:: VALUE_WITH_FAKE_GLOBALS :value: 2
Special value used to signal that an annotate function is being
evaluated in a special environment with fake globals. When passed this
value, annotate functions should either return the same value as for
the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedEr... | .. attribute:: VALUE_WITH_FAKE_GLOBALS :value: 2
Special value used to signal that an annotate function is being
evaluated in a special environment with fake globals. When passed this
value, annotate functions should either return the same value as for
the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedEr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1e559d46-593c-4861-b174-5ffe05d529fe | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,033 | supabase-export-v2 | 8fe4c8ef8b2d9f23 | course cannot recover any information that is not present in the compiled code, including comments, whitespace, parenthesization, and operations that get simplified by the compiler.
Second, the stringifier can intercept almost all operations that involve names looked
up in some scope, but it cannot intercept operations... | trusted_official_docs | CPython Docs | course cannot recover any information that is not present in the compiled code, including comments, whitespace, parenthesization, and operations that get simplified by the compiler.
Second, the stringifier can intercept almost all operations that involve names looked
up in some scope, but it cannot intercept operations... | course cannot recover any information that is not present in the compiled code, including comments, whitespace, parenthesization, and operations that get simplified by the compiler.
Second, the stringifier can intercept almost all operations that involve names looked
up in some scope, but it cannot intercept operations... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
21e731ba-f505-4222-b1d8-78178b70c2f4 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,969 | supabase-export-v2 | ffa32e4623427b97 | This is intended for use with the evaluate functions generated for lazily evaluated elements related to type aliases and type parameters:
* :meth:`typing.TypeAliasType.evaluate_value`, the value of type aliases
* :meth:`typing.TypeVar.evaluate_bound`, the bound of type variables
* :meth:`typing.TypeVar.evaluate_const... | trusted_official_docs | CPython Docs | This is intended for use with the evaluate functions generated for lazily evaluated elements related to type aliases and type parameters:
* :meth:`typing.TypeAliasType.evaluate_value`, the value of type aliases
* :meth:`typing.TypeVar.evaluate_bound`, the bound of type variables
* :meth:`typing.TypeVar.evaluate_const... | This is intended for use with the evaluate functions generated for lazily evaluated elements related to type aliases and type parameters:
* :meth:`typing.TypeAliasType.evaluate_value`, the value of type aliases
* :meth:`typing.TypeVar.evaluate_bound`, the bound of type variables
* :meth:`typing.TypeVar.evaluate_const... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
249c7b45-411d-4c19-89e0-a3b5ac8d0776 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,960 | supabase-export-v2 | ae103b1470c49cb8 | .. function:: call_annotate_function(annotate, format, *, owner=None)
Call the :term:`annotate function` *annotate* with the given *format*,
a member of the :class:`Format` enum, and return the annotations
dictionary produced by the function. | trusted_official_docs | CPython Docs | .. function:: call_annotate_function(annotate, format, *, owner=None)
Call the :term:`annotate function` *annotate* with the given *format*,
a member of the :class:`Format` enum, and return the annotations
dictionary produced by the function. | .. function:: call_annotate_function(annotate, format, *, owner=None)
Call the :term:`annotate function` *annotate* with the given *format*,
a member of the :class:`Format` enum, and return the annotations
dictionary produced by the function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e932591-945b-4fcb-8406-5c182ebf464f | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,928 | supabase-export-v2 | 6bb01b30a1535058 | annotations at module import time. Therefore, in Python 3.7, :pep:`563` introduced the ability to store annotations as strings using the ``from __future__ import annotations`` syntax.
The plan at the time was to
eventually make this behavior the default, but a problem appeared:
stringified annotations are more difficul... | trusted_official_docs | CPython Docs | annotations at module import time. Therefore, in Python 3.7, :pep:`563` introduced the ability to store annotations as strings using the ``from __future__ import annotations`` syntax.
The plan at the time was to
eventually make this behavior the default, but a problem appeared:
stringified annotations are more difficul... | annotations at module import time. Therefore, in Python 3.7, :pep:`563` introduced the ability to store annotations as strings using the ``from __future__ import annotations`` syntax.
The plan at the time was to
eventually make this behavior the default, but a problem appeared:
stringified annotations are more difficul... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3140ef6f-20a6-4c98-83cc-d2d7d278c1c1 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,037 | supabase-export-v2 | f7326dd369c2fb45 | This particular example works as of the time of writing, but it relies on implementation details and is not guaranteed to work in the future.
Among the different kinds of expressions that exist in Python,
as represented by the :mod:`ast` module, some expressions are supported,
meaning that the ``STRING`` format can gen... | trusted_official_docs | CPython Docs | This particular example works as of the time of writing, but it relies on implementation details and is not guaranteed to work in the future.
Among the different kinds of expressions that exist in Python,
as represented by the :mod:`ast` module, some expressions are supported,
meaning that the ``STRING`` format can gen... | This particular example works as of the time of writing, but it relies on implementation details and is not guaranteed to work in the future.
Among the different kinds of expressions that exist in Python,
as represented by the :mod:`ast` module, some expressions are supported,
meaning that the ``STRING`` format can gen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
321762bc-2000-4c34-b5cd-bd720dde25d3 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,058 | supabase-export-v2 | 6b25d7ffe9e49cd5 | is also true for any access of the :attr:`~object.__annotations__` attribute, and for various functions in the :mod:`typing` module that work with annotations, such as :func:`typing.get_type_hints`.
Any security issue arising from this also applies immediately after importing
code that may contain untrusted annotations... | trusted_official_docs | CPython Docs | is also true for any access of the :attr:`~object.__annotations__` attribute, and for various functions in the :mod:`typing` module that work with annotations, such as :func:`typing.get_type_hints`.
Any security issue arising from this also applies immediately after importing
code that may contain untrusted annotations... | is also true for any access of the :attr:`~object.__annotations__` attribute, and for various functions in the :mod:`typing` module that work with annotations, such as :func:`typing.get_type_hints`.
Any security issue arising from this also applies immediately after importing
code that may contain untrusted annotations... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3277275e-8810-4705-aa39-b5a528c57fc3 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,961 | supabase-export-v2 | a40587bb0b3a747b | Call the :term:`annotate function` *annotate* with the given *format*, a member of the :class:`Format` enum, and return the annotations dictionary produced by the function.
This helper function is required because annotate functions generated by
the compiler for functions, classes, and modules only support
the :attr:... | trusted_official_docs | CPython Docs | Call the :term:`annotate function` *annotate* with the given *format*, a member of the :class:`Format` enum, and return the annotations dictionary produced by the function.
This helper function is required because annotate functions generated by
the compiler for functions, classes, and modules only support
the :attr:... | Call the :term:`annotate function` *annotate* with the given *format*, a member of the :class:`Format` enum, and return the annotations dictionary produced by the function.
This helper function is required because annotate functions generated by
the compiler for functions, classes, and modules only support
the :attr:... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
345210c4-6d1d-4ae7-b4e7-3d5200f775bb | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,968 | supabase-export-v2 | 80fe27b6b6f6e392 | the function. This is similar to :func:`call_annotate_function`, but the latter always returns a dictionary mapping strings to annotations, while this function returns a single value.
This is intended for use with the evaluate functions generated for lazily
evaluated elements related to type aliases and type parameter... | trusted_official_docs | CPython Docs | the function. This is similar to :func:`call_annotate_function`, but the latter always returns a dictionary mapping strings to annotations, while this function returns a single value.
This is intended for use with the evaluate functions generated for lazily
evaluated elements related to type aliases and type parameter... | the function. This is similar to :func:`call_annotate_function`, but the latter always returns a dictionary mapping strings to annotations, while this function returns a single value.
This is intended for use with the evaluate functions generated for lazily
evaluated elements related to type aliases and type parameter... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c4c8f69-14be-4f72-8220-322dc8cdc9fc | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,984 | supabase-export-v2 | 1c15f497a0910a65 | used; otherwise, the :attr:`!object.__annotate__` function is called. If it does not exist either, :attr:`!object.__annotations__` is tried again and any error from accessing it is re-raised.
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.FORWARDREF`. If this is not implemented, it w... | trusted_official_docs | CPython Docs | used; otherwise, the :attr:`!object.__annotate__` function is called. If it does not exist either, :attr:`!object.__annotations__` is tried again and any error from accessing it is re-raised.
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.FORWARDREF`. If this is not implemented, it w... | used; otherwise, the :attr:`!object.__annotate__` function is called. If it does not exist either, :attr:`!object.__annotations__` is tried again and any error from accessing it is re-raised.
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.FORWARDREF`. If this is not implemented, it w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
44cac555-7603-49c4-ae86-6da5a5e62863 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,992 | supabase-export-v2 | ab6af4d567b22d73 | raises an exception, it will unwind the stack past the :func:`!get_annotations` call.) * If *eval_str* is false (the default), values of type :class:`!str` are unchanged.
*globals* and *locals* are passed in to :func:`eval`; see the documentation
for :func:`eval` for more information. If *globals* or *locals*
is :con... | trusted_official_docs | CPython Docs | raises an exception, it will unwind the stack past the :func:`!get_annotations` call.) * If *eval_str* is false (the default), values of type :class:`!str` are unchanged.
*globals* and *locals* are passed in to :func:`eval`; see the documentation
for :func:`eval` for more information. If *globals* or *locals*
is :con... | raises an exception, it will unwind the stack past the :func:`!get_annotations` call.) * If *eval_str* is false (the default), values of type :class:`!str` are unchanged.
*globals* and *locals* are passed in to :func:`eval`; see the documentation
for :func:`eval` for more information. If *globals* or *locals*
is :con... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
45641b0b-113b-4fa8-8832-2696779b5d46 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,016 | supabase-export-v2 | f9b09f31a2fbd351 | * A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not raise a :exc:`NotImplementedError` when called with a supported format.
To provide the :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` format, which is used to
automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if t... | trusted_official_docs | CPython Docs | * A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not raise a :exc:`NotImplementedError` when called with a supported format.
To provide the :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` format, which is used to
automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if t... | * A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not raise a :exc:`NotImplementedError` when called with a supported format.
To provide the :attr:`~Format.VALUE_WITH_FAKE_GLOBALS` format, which is used to
automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4baf080b-0bde-4185-af93-e5b004422e65 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,008 | supabase-export-v2 | 2fa8785b5c02b6a5 | import annotationlib import typing
class ClassVarSeparator(type):
def __new__(mcls, name, bases, ns):
if "__annotations__" in ns: # from __future__ import annotations
annotations = ns["__annotations__"]
classvar_keys = {
key for key, value in annotations.items()
# Use string comparison for simplicity; a more robu... | trusted_official_docs | CPython Docs | import annotationlib import typing
class ClassVarSeparator(type):
def __new__(mcls, name, bases, ns):
if "__annotations__" in ns: # from __future__ import annotations
annotations = ns["__annotations__"]
classvar_keys = {
key for key, value in annotations.items()
# Use string comparison for simplicity; a more robu... | import annotationlib import typing
class ClassVarSeparator(type):
def __new__(mcls, name, bases, ns):
if "__annotations__" in ns: # from __future__ import annotations
annotations = ns["__annotations__"]
classvar_keys = {
key for key, value in annotations.items()
# Use string comparison for simplicity; a more robu... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c0635c1-2775-469b-9094-55c8bb4abe78 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,967 | supabase-export-v2 | cfe1e1fae651327c | .. function:: call_evaluate_function(evaluate, format, *, owner=None)
Call the :term:`evaluate function` *evaluate* with the given *format*,
a member of the :class:`Format` enum, and return the value produced by
the function. This is similar to :func:`call_annotate_function`,
but the latter always returns a dictiona... | trusted_official_docs | CPython Docs | .. function:: call_evaluate_function(evaluate, format, *, owner=None)
Call the :term:`evaluate function` *evaluate* with the given *format*,
a member of the :class:`Format` enum, and return the value produced by
the function. This is similar to :func:`call_annotate_function`,
but the latter always returns a dictiona... | .. function:: call_evaluate_function(evaluate, format, *, owner=None)
Call the :term:`evaluate function` *evaluate* with the given *format*,
a member of the :class:`Format` enum, and return the value produced by
the function. This is similar to :func:`call_annotate_function`,
but the latter always returns a dictiona... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4f88f491-b9bd-4608-bd96-6e2c45a4918a | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,926 | supabase-export-v2 | 28507d894f62eb2b | This will behave as follows:
* Under stock semantics (Python 3.13 and earlier), it will throw a
:exc:`NameError` at the line where ``func`` is defined,
because ``Cls`` is an undefined name at that point. * Under stringified annotations (if ``from __future__ import annotations``
is used), it will print ``{'a': 'Cls',... | trusted_official_docs | CPython Docs | This will behave as follows:
* Under stock semantics (Python 3.13 and earlier), it will throw a
:exc:`NameError` at the line where ``func`` is defined,
because ``Cls`` is an undefined name at that point. * Under stringified annotations (if ``from __future__ import annotations``
is used), it will print ``{'a': 'Cls',... | This will behave as follows:
* Under stock semantics (Python 3.13 and earlier), it will throw a
:exc:`NameError` at the line where ``func`` is defined,
because ``Cls`` is an undefined name at that point. * Under stringified annotations (if ``from __future__ import annotations``
is used), it will print ``{'a': 'Cls',... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
529346d8-78de-4fde-ab4a-81a64a68b8a6 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,054 | supabase-export-v2 | 234ab49a24ced88e | .. code-block:: pycon
>>> from annotationlib import get_annotations, Format
>>> def zerodiv(x: 1 / 0): ... >>> get_annotations(zerodiv, format=Format.STRING)
Traceback (most recent call last):
... ZeroDivisionError: division by zero
>>> get_annotations(zerodiv, format=Format.FORWARDREF)
Traceback (most recent call... | trusted_official_docs | CPython Docs | .. code-block:: pycon
>>> from annotationlib import get_annotations, Format
>>> def zerodiv(x: 1 / 0): ... >>> get_annotations(zerodiv, format=Format.STRING)
Traceback (most recent call last):
... ZeroDivisionError: division by zero
>>> get_annotations(zerodiv, format=Format.FORWARDREF)
Traceback (most recent call... | .. code-block:: pycon
>>> from annotationlib import get_annotations, Format
>>> def zerodiv(x: 1 / 0): ... >>> get_annotations(zerodiv, format=Format.STRING)
Traceback (most recent call last):
... ZeroDivisionError: division by zero
>>> get_annotations(zerodiv, format=Format.FORWARDREF)
Traceback (most recent call... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d8efe82-7cbd-4df3-af05-6ee497c407ed | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,920 | supabase-export-v2 | cc3b5677093ea8ec | Annotation semantics --------------------
The way annotations are evaluated has changed over the history of Python 3,
and currently still depends on a :ref:`future import <future>`. There have been execution models for annotations: | trusted_official_docs | CPython Docs | Annotation semantics --------------------
The way annotations are evaluated has changed over the history of Python 3,
and currently still depends on a :ref:`future import <future>`. There have been execution models for annotations: | Annotation semantics --------------------
The way annotations are evaluated has changed over the history of Python 3,
and currently still depends on a :ref:`future import <future>`. There have been execution models for annotations: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
62fb2ae3-5251-4651-a2c4-56b9ab5a5dc7 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,000 | supabase-export-v2 | b766345cf0cfc59b | format suitable for use by the :attr:`~Format.STRING` format. This calls :func:`repr` for most objects, but has special handling for some objects, such as type objects.
This is meant as a helper for user-provided
annotate functions that support the :attr:`~Format.STRING` format but
do not have access to the code crea... | trusted_official_docs | CPython Docs | format suitable for use by the :attr:`~Format.STRING` format. This calls :func:`repr` for most objects, but has special handling for some objects, such as type objects.
This is meant as a helper for user-provided
annotate functions that support the :attr:`~Format.STRING` format but
do not have access to the code crea... | format suitable for use by the :attr:`~Format.STRING` format. This calls :func:`repr` for most objects, but has special handling for some objects, such as type objects.
This is meant as a helper for user-provided
annotate functions that support the :attr:`~Format.STRING` format but
do not have access to the code crea... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
67f3a633-de7d-44fc-a26c-2a73345f61d1 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,910 | supabase-export-v2 | 0ce1a116932c1924 | This module supports retrieving annotations in three main formats (see :class:`Format`), each of which works best for different use cases:
* :attr:`~Format.VALUE` evaluates the annotations and returns their value. This is most straightforward to work with, but it may raise errors,
for example if the annotations contai... | trusted_official_docs | CPython Docs | This module supports retrieving annotations in three main formats (see :class:`Format`), each of which works best for different use cases:
* :attr:`~Format.VALUE` evaluates the annotations and returns their value. This is most straightforward to work with, but it may raise errors,
for example if the annotations contai... | This module supports retrieving annotations in three main formats (see :class:`Format`), each of which works best for different use cases:
* :attr:`~Format.VALUE` evaluates the annotations and returns their value. This is most straightforward to work with, but it may raise errors,
for example if the annotations contai... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6835e59e-b2f0-4c18-9b39-622d45ac92ef | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,012 | supabase-export-v2 | c26d3cf8439e1c35 | the original __annotate__ with a wrapper that removes ClassVars typ.__annotate__ = wrapped_annotate typ.classvars = classvars # Store the ClassVars in a separate attribute return typ
Creating a custom callable annotate function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | trusted_official_docs | CPython Docs | the original __annotate__ with a wrapper that removes ClassVars typ.__annotate__ = wrapped_annotate typ.classvars = classvars # Store the ClassVars in a separate attribute return typ
Creating a custom callable annotate function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | the original __annotate__ with a wrapper that removes ClassVars typ.__annotate__ = wrapped_annotate typ.classvars = classvars # Store the ClassVars in a separate attribute return typ
Creating a custom callable annotate function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b63a375-357e-4251-ab8f-aba0e4fd4980 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,954 | supabase-export-v2 | 3a728028572cee11 | .. function:: annotations_to_string(annotations)
Convert an annotations dict containing runtime values to a
dict containing only strings. If the values are not already strings,
they are converted using :func:`type_repr`. This is meant as a helper for user-provided
annotate functions that support the :attr:`~Format.S... | trusted_official_docs | CPython Docs | .. function:: annotations_to_string(annotations)
Convert an annotations dict containing runtime values to a
dict containing only strings. If the values are not already strings,
they are converted using :func:`type_repr`. This is meant as a helper for user-provided
annotate functions that support the :attr:`~Format.S... | .. function:: annotations_to_string(annotations)
Convert an annotations dict containing runtime values to a
dict containing only strings. If the values are not already strings,
they are converted using :func:`type_repr`. This is meant as a helper for user-provided
annotate functions that support the :attr:`~Format.S... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6d69351e-672e-46c9-95e9-3890a604c03e | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,955 | supabase-export-v2 | 113cc65d56a0538c | is meant as a helper for user-provided annotate functions that support the :attr:`~Format.STRING` format but do not have access to the code creating the annotations.
For example, this is used to implement the :attr:`~Format.STRING` for
:class:`typing.TypedDict` classes created through the functional syntax: | trusted_official_docs | CPython Docs | is meant as a helper for user-provided annotate functions that support the :attr:`~Format.STRING` format but do not have access to the code creating the annotations.
For example, this is used to implement the :attr:`~Format.STRING` for
:class:`typing.TypedDict` classes created through the functional syntax: | is meant as a helper for user-provided annotate functions that support the :attr:`~Format.STRING` format but do not have access to the code creating the annotations.
For example, this is used to implement the :attr:`~Format.STRING` for
:class:`typing.TypedDict` classes created through the functional syntax: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
709fc447-f286-45ec-86d1-0fd1e6099856 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,938 | supabase-export-v2 | c55dc2b3733642f4 | .. attribute:: STRING :value: 4
Values are the text string of the annotation as it appears in the
source code, up to modifications including, but not restricted to,
whitespace normalizations and constant values optimizations. | trusted_official_docs | CPython Docs | .. attribute:: STRING :value: 4
Values are the text string of the annotation as it appears in the
source code, up to modifications including, but not restricted to,
whitespace normalizations and constant values optimizations. | .. attribute:: STRING :value: 4
Values are the text string of the annotation as it appears in the
source code, up to modifications including, but not restricted to,
whitespace normalizations and constant values optimizations. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
72e42232-63ac-4aa2-a691-0875c9da947b | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,003 | supabase-export-v2 | 7737fd61c30132d1 | Using annotations in a metaclass ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A :ref:`metaclass <metaclasses>` may want to inspect or even modify the annotations
in a class body during class creation. Doing so requires retrieving annotations
from the class namespace dictionary. For classes created with
``from __future__ import ann... | trusted_official_docs | CPython Docs | Using annotations in a metaclass ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A :ref:`metaclass <metaclasses>` may want to inspect or even modify the annotations
in a class body during class creation. Doing so requires retrieving annotations
from the class namespace dictionary. For classes created with
``from __future__ import ann... | Using annotations in a metaclass ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A :ref:`metaclass <metaclasses>` may want to inspect or even modify the annotations
in a class body during class creation. Doing so requires retrieving annotations
from the class namespace dictionary. For classes created with
``from __future__ import ann... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7588d918-8f2b-4bfa-81b7-135b82724819 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,983 | supabase-export-v2 | 6f63ded654b5b507 | * VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist, the :attr:`!object.__annotate__` function is called if it exists.
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it... | trusted_official_docs | CPython Docs | * VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist, the :attr:`!object.__annotate__` function is called if it exists.
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it... | * VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist, the :attr:`!object.__annotate__` function is called if it exists.
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7900aeb7-f7c7-4a3c-9bec-9755754072c8 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,973 | supabase-export-v2 | c53a713baa75b66b | .. doctest::
>>> type Alias = undefined
>>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)
Traceback (most recent call last):
... NameError: name 'undefined' is not defined
>>> call_evaluate_function(Alias.evaluate_value, Format.FORWARDREF)
ForwardRef('undefined')
>>> call_evaluate_function(Alias.eval... | trusted_official_docs | CPython Docs | .. doctest::
>>> type Alias = undefined
>>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)
Traceback (most recent call last):
... NameError: name 'undefined' is not defined
>>> call_evaluate_function(Alias.evaluate_value, Format.FORWARDREF)
ForwardRef('undefined')
>>> call_evaluate_function(Alias.eval... | .. doctest::
>>> type Alias = undefined
>>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)
Traceback (most recent call last):
... NameError: name 'undefined' is not defined
>>> call_evaluate_function(Alias.evaluate_value, Format.FORWARDREF)
ForwardRef('undefined')
>>> call_evaluate_function(Alias.eval... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7f4638da-b20f-410a-a497-d31e1e8934a6 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,921 | supabase-export-v2 | 4e77082534655880 | evaluated has changed over the history of Python 3, and currently still depends on a :ref:`future import <future>`. There have been execution models for annotations:
* *Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107`
and :pep:`526`): Annotations are evaluated eagerly, as they are
encountered in ... | trusted_official_docs | CPython Docs | evaluated has changed over the history of Python 3, and currently still depends on a :ref:`future import <future>`. There have been execution models for annotations:
* *Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107`
and :pep:`526`): Annotations are evaluated eagerly, as they are
encountered in ... | evaluated has changed over the history of Python 3, and currently still depends on a :ref:`future import <future>`. There have been execution models for annotations:
* *Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107`
and :pep:`526`): Annotations are evaluated eagerly, as they are
encountered in ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ffce0cf-78c9-4698-ab90-623096a98850 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,999 | supabase-export-v2 | 9a49a3f2f18c285c | .. function:: type_repr(value)
Convert an arbitrary Python value to a format suitable for use by the
:attr:`~Format.STRING` format. This calls :func:`repr` for most
objects, but has special handling for some objects, such as type objects. | trusted_official_docs | CPython Docs | .. function:: type_repr(value)
Convert an arbitrary Python value to a format suitable for use by the
:attr:`~Format.STRING` format. This calls :func:`repr` for most
objects, but has special handling for some objects, such as type objects. | .. function:: type_repr(value)
Convert an arbitrary Python value to a format suitable for use by the
:attr:`~Format.STRING` format. This calls :func:`repr` for most
objects, but has special handling for some objects, such as type objects. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
82962bf4-46c7-4036-b6ec-45a8b897ce16 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,038 | supabase-export-v2 | 82a047dffd064e9e | that the ``STRING`` format can generally recover the original source code; others are unsupported, meaning that they may result in incorrect output or an error.
The following are supported (sometimes with caveats): | trusted_official_docs | CPython Docs | that the ``STRING`` format can generally recover the original source code; others are unsupported, meaning that they may result in incorrect output or an error.
The following are supported (sometimes with caveats): | that the ``STRING`` format can generally recover the original source code; others are unsupported, meaning that they may result in incorrect output or an error.
The following are supported (sometimes with caveats): | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
844fed02-efbe-49af-af53-cfb5e81fc595 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,911 | supabase-export-v2 | f7c9b23750599544 | similar to how it would appear in the source file. This is useful for documentation generators that want to display annotations in a readable way.
The :func:`get_annotations` function is the main entry point for
retrieving annotations. Given a function, class, or module, it returns
an annotations dictionary in the requ... | trusted_official_docs | CPython Docs | similar to how it would appear in the source file. This is useful for documentation generators that want to display annotations in a readable way.
The :func:`get_annotations` function is the main entry point for
retrieving annotations. Given a function, class, or module, it returns
an annotations dictionary in the requ... | similar to how it would appear in the source file. This is useful for documentation generators that want to display annotations in a readable way.
The :func:`get_annotations` function is the main entry point for
retrieving annotations. Given a function, class, or module, it returns
an annotations dictionary in the requ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
88f2e389-d029-4c0c-994c-0b527e6951fc | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,051 | supabase-export-v2 | 9b008c4acc40cc01 | Limitations of the ``FORWARDREF`` format ----------------------------------------
The :attr:`~Format.FORWARDREF` format aims to produce real values as much
as possible, with anything that cannot be resolved replaced with
:class:`ForwardRef` objects. It is affected by broadly the same Limitations
as the :attr:`~Format.S... | trusted_official_docs | CPython Docs | Limitations of the ``FORWARDREF`` format ----------------------------------------
The :attr:`~Format.FORWARDREF` format aims to produce real values as much
as possible, with anything that cannot be resolved replaced with
:class:`ForwardRef` objects. It is affected by broadly the same Limitations
as the :attr:`~Format.S... | Limitations of the ``FORWARDREF`` format ----------------------------------------
The :attr:`~Format.FORWARDREF` format aims to produce real values as much
as possible, with anything that cannot be resolved replaced with
:class:`ForwardRef` objects. It is affected by broadly the same Limitations
as the :attr:`~Format.S... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
91dc198d-e588-4725-bc6a-0562566ea095 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,052 | supabase-export-v2 | 1c8d263604a7e124 | as the :attr:`~Format.STRING` format: annotations that perform operations on literals or that use unsupported expression types may raise exceptions when evaluated using the :attr:`~Format.FORWARDREF` format.
Below are a few examples of the behavior with unsupported expressions: | trusted_official_docs | CPython Docs | as the :attr:`~Format.STRING` format: annotations that perform operations on literals or that use unsupported expression types may raise exceptions when evaluated using the :attr:`~Format.FORWARDREF` format.
Below are a few examples of the behavior with unsupported expressions: | as the :attr:`~Format.STRING` format: annotations that perform operations on literals or that use unsupported expression types may raise exceptions when evaluated using the :attr:`~Format.FORWARDREF` format.
Below are a few examples of the behavior with unsupported expressions: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9438c2ee-9b7d-4562-bf88-95cbfdb9dbf0 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,043 | supabase-export-v2 | c871539c3a933b03 | are supported * :class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are supported, but the operand may be flipped * :class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` are not supported
* :class:`ast.Call` (except when using ``**`` unpacking)
* :class:`ast.Constant` (though... | trusted_official_docs | CPython Docs | are supported * :class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are supported, but the operand may be flipped * :class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` are not supported
* :class:`ast.Call` (except when using ``**`` unpacking)
* :class:`ast.Constant` (though... | are supported * :class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are supported, but the operand may be flipped * :class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` are not supported
* :class:`ast.Call` (except when using ``**`` unpacking)
* :class:`ast.Constant` (though... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9c4b5119-e2cf-4b3b-951e-520ee313182e | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,045 | supabase-export-v2 | 4161bba2ac747600 | The following are unsupported, but throw an informative error when encountered by the stringifier:
* :class:`ast.FormattedValue` (f-strings; error is not detected if conversion specifiers like ``!r``
are used)
* :class:`ast.JoinedStr` (f-strings) | trusted_official_docs | CPython Docs | The following are unsupported, but throw an informative error when encountered by the stringifier:
* :class:`ast.FormattedValue` (f-strings; error is not detected if conversion specifiers like ``!r``
are used)
* :class:`ast.JoinedStr` (f-strings) | The following are unsupported, but throw an informative error when encountered by the stringifier:
* :class:`ast.FormattedValue` (f-strings; error is not detected if conversion specifiers like ``!r``
are used)
* :class:`ast.JoinedStr` (f-strings) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9f3a8566-a563-4b2b-b2bd-073cf56e802c | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,991 | supabase-export-v2 | 15b39b75c0e27cde | *eval_str* controls whether or not values of type :class:`!str` are replaced with the result of calling :func:`eval` on those values:
* If eval_str is true, :func:`eval` is called on values of type
:class:`!str`. (Note that :func:`!get_annotations` doesn't catch
exceptions; if :func:`eval` raises an exception, it wil... | trusted_official_docs | CPython Docs | *eval_str* controls whether or not values of type :class:`!str` are replaced with the result of calling :func:`eval` on those values:
* If eval_str is true, :func:`eval` is called on values of type
:class:`!str`. (Note that :func:`!get_annotations` doesn't catch
exceptions; if :func:`eval` raises an exception, it wil... | *eval_str* controls whether or not values of type :class:`!str` are replaced with the result of calling :func:`eval` on those values:
* If eval_str is true, :func:`eval` is called on values of type
:class:`!str`. (Note that :func:`!get_annotations` doesn't catch
exceptions; if :func:`eval` raises an exception, it wil... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a08eb363-1552-4212-bd33-2a469bacf4de | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,010 | supabase-export-v2 | 3355c1d6bf2d74e8 | def wrapped_annotate(format): annos = annotationlib.call_annotate_function(annotate, format, owner=typ) return {key: value for key, value in annos.items() if key not in classvar_keys}
else: # no annotations
classvars = {}
wrapped_annotate = None
typ = super().__new__(mcls, name, bases, ns) | trusted_official_docs | CPython Docs | def wrapped_annotate(format): annos = annotationlib.call_annotate_function(annotate, format, owner=typ) return {key: value for key, value in annos.items() if key not in classvar_keys}
else: # no annotations
classvars = {}
wrapped_annotate = None
typ = super().__new__(mcls, name, bases, ns) | def wrapped_annotate(format): annos = annotationlib.call_annotate_function(annotate, format, owner=typ) return {key: value for key, value in annos.items() if key not in classvar_keys}
else: # no annotations
classvars = {}
wrapped_annotate = None
typ = super().__new__(mcls, name, bases, ns) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a2b696f7-e1d3-41dc-b1ab-90bc083f4cff | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,922 | supabase-export-v2 | 9e5f47b4587d4c54 | as strings only. * *Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` and :pep:`749`): Annotations are evaluated lazily, only when they are accessed.
As an example, consider the following program:: | trusted_official_docs | CPython Docs | as strings only. * *Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` and :pep:`749`): Annotations are evaluated lazily, only when they are accessed.
As an example, consider the following program:: | as strings only. * *Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` and :pep:`749`): Annotations are evaluated lazily, only when they are accessed.
As an example, consider the following program:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a599e8aa-50c9-45fe-8d9c-691215bf4eff | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,936 | supabase-export-v2 | ab0d3cdb5a0991fb | .. attribute:: FORWARDREF :value: 3
Values are real annotation values (as per :attr:`Format.VALUE` format)
for defined values, and :class:`ForwardRef` proxies for undefined
values. Real objects may contain references to :class:`ForwardRef`
proxy objects. | trusted_official_docs | CPython Docs | .. attribute:: FORWARDREF :value: 3
Values are real annotation values (as per :attr:`Format.VALUE` format)
for defined values, and :class:`ForwardRef` proxies for undefined
values. Real objects may contain references to :class:`ForwardRef`
proxy objects. | .. attribute:: FORWARDREF :value: 3
Values are real annotation values (as per :attr:`Format.VALUE` format)
for defined values, and :class:`ForwardRef` proxies for undefined
values. Real objects may contain references to :class:`ForwardRef`
proxy objects. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
adb9e8b2-7baf-444c-96c0-a558df09aff5 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,986 | supabase-export-v2 | 356b1c4f255d1664 | * STRING: If :attr:`!object.__annotate__` exists, it is called first; otherwise, :attr:`!object.__annotations__` is used and stringified using :func:`annotations_to_string`.
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.STRING`. If this is not implemented, it will then check if :att... | trusted_official_docs | CPython Docs | * STRING: If :attr:`!object.__annotate__` exists, it is called first; otherwise, :attr:`!object.__annotations__` is used and stringified using :func:`annotations_to_string`.
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.STRING`. If this is not implemented, it will then check if :att... | * STRING: If :attr:`!object.__annotate__` exists, it is called first; otherwise, :attr:`!object.__annotations__` is used and stringified using :func:`annotations_to_string`.
* When calling :attr:`!object.__annotate__` it is first called with :attr:`~Format.STRING`. If this is not implemented, it will then check if :att... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b136e2a3-dee1-4cae-a4ee-2cdd2bcc5ae7 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,993 | supabase-export-v2 | 8d97080138d1d97a | documentation for :func:`eval` for more information. If *globals* or *locals* is :const:`!None`, this function may replace that value with a context-specific default, contingent on ``type(obj)``:
* If *obj* is a module, *globals* defaults to ``obj.__dict__``. * If *obj* is a class, *globals* defaults to
``sys.modules[... | trusted_official_docs | CPython Docs | documentation for :func:`eval` for more information. If *globals* or *locals* is :const:`!None`, this function may replace that value with a context-specific default, contingent on ``type(obj)``:
* If *obj* is a module, *globals* defaults to ``obj.__dict__``. * If *obj* is a class, *globals* defaults to
``sys.modules[... | documentation for :func:`eval` for more information. If *globals* or *locals* is :const:`!None`, this function may replace that value with a context-specific default, contingent on ``type(obj)``:
* If *obj* is a module, *globals* defaults to ``obj.__dict__``. * If *obj* is a class, *globals* defaults to
``sys.modules[... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b9bcc380-1e9c-4d74-a49d-ec11287674b0 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,014 | supabase-export-v2 | 8278b58ecee4abd9 | and modules. Or, they may wish to utilise the encapsulation provided by classes, in which case any :term:`callable` can be used as an :term:`annotate function`.
To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or
:attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide
the fol... | trusted_official_docs | CPython Docs | and modules. Or, they may wish to utilise the encapsulation provided by classes, in which case any :term:`callable` can be used as an :term:`annotate function`.
To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or
:attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide
the fol... | and modules. Or, they may wish to utilise the encapsulation provided by classes, in which case any :term:`callable` can be used as an :term:`annotate function`.
To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or
:attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide
the fol... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ba6b30e2-33c7-4c73-bd2e-6ed8de6b18b6 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,931 | supabase-export-v2 | 6c02ad32aed051ab | of the enum, or their equivalent integer values, can be passed to :func:`get_annotations` and other functions in this module, as well as to :attr:`~object.__annotate__` functions.
.. attribute:: VALUE
:value: 1 | trusted_official_docs | CPython Docs | of the enum, or their equivalent integer values, can be passed to :func:`get_annotations` and other functions in this module, as well as to :attr:`~object.__annotate__` functions.
.. attribute:: VALUE
:value: 1 | of the enum, or their equivalent integer values, can be passed to :func:`get_annotations` and other functions in this module, as well as to :attr:`~object.__annotate__` functions.
.. attribute:: VALUE
:value: 1 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
be742550-9a3e-4081-a07c-41a76df12acb | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,942 | supabase-export-v2 | 7d4d581ffa5e51d9 | A proxy object for forward references in annotations.
Instances of this class are returned when the :attr:`~Format.FORWARDREF`
format is used and annotations contain a name that cannot be resolved. This can happen when a forward reference is used in an annotation, such as
when a class is referenced before it is defin... | trusted_official_docs | CPython Docs | A proxy object for forward references in annotations.
Instances of this class are returned when the :attr:`~Format.FORWARDREF`
format is used and annotations contain a name that cannot be resolved. This can happen when a forward reference is used in an annotation, such as
when a class is referenced before it is defin... | A proxy object for forward references in annotations.
Instances of this class are returned when the :attr:`~Format.FORWARDREF`
format is used and annotations contain a name that cannot be resolved. This can happen when a forward reference is used in an annotation, such as
when a class is referenced before it is defin... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bfac11a8-6689-4ab0-bcfe-0cba69938949 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,908 | supabase-export-v2 | 657bcfd31c77dbfd | The :mod:`!annotationlib` module provides tools for introspecting :term:`annotations <annotation>` on modules, classes, and functions.
Annotations are :ref:`lazily evaluated <lazy-evaluation>` and often contain
forward references to objects that are not yet defined when the annotation
is created. This module provides a... | trusted_official_docs | CPython Docs | The :mod:`!annotationlib` module provides tools for introspecting :term:`annotations <annotation>` on modules, classes, and functions.
Annotations are :ref:`lazily evaluated <lazy-evaluation>` and often contain
forward references to objects that are not yet defined when the annotation
is created. This module provides a... | The :mod:`!annotationlib` module provides tools for introspecting :term:`annotations <annotation>` on modules, classes, and functions.
Annotations are :ref:`lazily evaluated <lazy-evaluation>` and often contain
forward references to objects that are not yet defined when the annotation
is created. This module provides a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca709d98-64b1-4637-8ded-36efa0d8c0ca | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,057 | supabase-export-v2 | d5b2e3a20c1477e7 | Security implications of introspecting annotations --------------------------------------------------
Much of the functionality in this module involves executing code related to annotations,
which can then do arbitrary things. For example,
:func:`get_annotations` may call an arbitrary :term:`annotate function`, and
:me... | trusted_official_docs | CPython Docs | Security implications of introspecting annotations --------------------------------------------------
Much of the functionality in this module involves executing code related to annotations,
which can then do arbitrary things. For example,
:func:`get_annotations` may call an arbitrary :term:`annotate function`, and
:me... | Security implications of introspecting annotations --------------------------------------------------
Much of the functionality in this module involves executing code related to annotations,
which can then do arbitrary things. For example,
:func:`get_annotations` may call an arbitrary :term:`annotate function`, and
:me... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.