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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cd782ad2-c0e6-4432-a91d-42dbbfc9fd94 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,970 | supabase-export-v2 | e761bc852b072cfa | * :meth:`typing.TypeVar.evaluate_default`, the default value of type variables * :meth:`typing.ParamSpec.evaluate_default`, the default value of parameter specifications * :meth:`typing.TypeVarTuple.evaluate_default`, the default value of type variable tuples
*owner* is the object that owns the evaluate function, such ... | trusted_official_docs | CPython Docs | * :meth:`typing.TypeVar.evaluate_default`, the default value of type variables * :meth:`typing.ParamSpec.evaluate_default`, the default value of parameter specifications * :meth:`typing.TypeVarTuple.evaluate_default`, the default value of type variable tuples
*owner* is the object that owns the evaluate function, such ... | * :meth:`typing.TypeVar.evaluate_default`, the default value of type variables * :meth:`typing.ParamSpec.evaluate_default`, the default value of parameter specifications * :meth:`typing.TypeVarTuple.evaluate_default`, the default value of type variable tuples
*owner* is the object that owns the evaluate function, such ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cec20d3a-ed40-4d4e-8a5e-d888a90c21a1 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,015 | supabase-export-v2 | 9f0ce0dc720efaa8 | To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or :attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide the following attribute:
* A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not
raise a :exc:`NotImplementedError` when called with a ... | trusted_official_docs | CPython Docs | To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or :attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide the following attribute:
* A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not
raise a :exc:`NotImplementedError` when called with a ... | To provide the :attr:`~Format.VALUE`, :attr:`~Format.STRING`, or :attr:`~Format.FORWARDREF` formats directly, an :term:`annotate function` must provide the following attribute:
* A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not
raise a :exc:`NotImplementedError` when called with a ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ddc17cfd-c835-4c1d-9331-31e989305c7e | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,021 | supabase-export-v2 | 37e050f7f5db3c0d | globals, `_self` will be the # actual self value, and `self` will be the format. if _self is not None: self, format = _self, self
self.called_formats.append(format)
if format <= 2: # VALUE or VALUE_WITH_FAKE_GLOBALS
return {"x": MyType}
raise NotImplementedError | trusted_official_docs | CPython Docs | globals, `_self` will be the # actual self value, and `self` will be the format. if _self is not None: self, format = _self, self
self.called_formats.append(format)
if format <= 2: # VALUE or VALUE_WITH_FAKE_GLOBALS
return {"x": MyType}
raise NotImplementedError | globals, `_self` will be the # actual self value, and `self` will be the format. if _self is not None: self, format = _self, self
self.called_formats.append(format)
if format <= 2: # VALUE or VALUE_WITH_FAKE_GLOBALS
return {"x": MyType}
raise NotImplementedError | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ddec03cc-ca50-48ef-8a4f-c56d8c8ba7cd | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,988 | supabase-export-v2 | c601ce999880b0c3 | a dict. :func:`!get_annotations` returns a new dict every time it's called; calling it twice on the same object will return two different but equivalent dicts.
This function handles several details for you: | trusted_official_docs | CPython Docs | a dict. :func:`!get_annotations` returns a new dict every time it's called; calling it twice on the same object will return two different but equivalent dicts.
This function handles several details for you: | a dict. :func:`!get_annotations` returns a new dict every time it's called; calling it twice on the same object will return two different but equivalent dicts.
This function handles several details for you: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e09e127c-0534-42cb-bbb9-0c5ed7609026 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,036 | supabase-export-v2 | da1973f77a96e5a6 | >>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__.__builtins__["print"]("Hello world")): pass ... >>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING) Hello world {'x': 'None'}
.. note::
This particular example works as of the time of writing, but it relies on
implementation detail... | trusted_official_docs | CPython Docs | >>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__.__builtins__["print"]("Hello world")): pass ... >>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING) Hello world {'x': 'None'}
.. note::
This particular example works as of the time of writing, but it relies on
implementation detail... | >>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__.__builtins__["print"]("Hello world")): pass ... >>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING) Hello world {'x': 'None'}
.. note::
This particular example works as of the time of writing, but it relies on
implementation detail... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e32f9288-0180-4049-a8ba-eb5cf5981835 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,042 | supabase-export-v2 | b186d426b678e1fe | * :class:`ast.Dict` (except when using ``**`` unpacking) * :class:`ast.Set` * :class:`ast.Compare`
* :class:`ast.Eq` and :class:`ast.NotEq` 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`, :cla... | trusted_official_docs | CPython Docs | * :class:`ast.Dict` (except when using ``**`` unpacking) * :class:`ast.Set` * :class:`ast.Compare`
* :class:`ast.Eq` and :class:`ast.NotEq` 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`, :cla... | * :class:`ast.Dict` (except when using ``**`` unpacking) * :class:`ast.Set` * :class:`ast.Compare`
* :class:`ast.Eq` and :class:`ast.NotEq` 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`, :cla... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e56bcb12-1b1d-4714-b83f-3a92fd81553a | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,987 | supabase-export-v2 | 6569c31a3f547b38 | supported, it will fall back to using :attr:`~Format.VALUE` with the result converted using :func:`annotations_to_string`. If :attr:`~Format.VALUE` fails, the error from this call will be raised.
Returns a dict. :func:`!get_annotations` returns a new dict every time
it's called; calling it twice on the same object wil... | trusted_official_docs | CPython Docs | supported, it will fall back to using :attr:`~Format.VALUE` with the result converted using :func:`annotations_to_string`. If :attr:`~Format.VALUE` fails, the error from this call will be raised.
Returns a dict. :func:`!get_annotations` returns a new dict every time
it's called; calling it twice on the same object wil... | supported, it will fall back to using :attr:`~Format.VALUE` with the result converted using :func:`annotations_to_string`. If :attr:`~Format.VALUE` fails, the error from this call will be raised.
Returns a dict. :func:`!get_annotations` returns a new dict every time
it's called; calling it twice on the same object wil... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e56f531c-1b1b-4db8-8b8a-2470cc8fc5ef | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,949 | supabase-export-v2 | a4f562d973add55f | of a :class:`~ForwardRef` is the object that contains the annotation from which the :class:`~ForwardRef` derives, such as a module object, type object, or function object.
The *globals*, *locals*, and *type_params* parameters provide a more precise
mechanism for influencing the names that are available when the :class... | trusted_official_docs | CPython Docs | of a :class:`~ForwardRef` is the object that contains the annotation from which the :class:`~ForwardRef` derives, such as a module object, type object, or function object.
The *globals*, *locals*, and *type_params* parameters provide a more precise
mechanism for influencing the names that are available when the :class... | of a :class:`~ForwardRef` is the object that contains the annotation from which the :class:`~ForwardRef` derives, such as a module object, type object, or function object.
The *globals*, *locals*, and *type_params* parameters provide a more precise
mechanism for influencing the names that are available when the :class... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e5815d20-187c-4551-9add-3c33a285b7cb | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,004 | supabase-export-v2 | 75ff1c9913095ba2 | :attr:`~Format.FORWARDREF` format will usually be best, because this allows the annotations to refer to names that cannot yet be resolved when the class is created.
To modify the annotations, it is best to create a wrapper annotate function
that calls the original annotate function, makes any necessary adjustments, and... | trusted_official_docs | CPython Docs | :attr:`~Format.FORWARDREF` format will usually be best, because this allows the annotations to refer to names that cannot yet be resolved when the class is created.
To modify the annotations, it is best to create a wrapper annotate function
that calls the original annotate function, makes any necessary adjustments, and... | :attr:`~Format.FORWARDREF` format will usually be best, because this allows the annotations to refer to names that cannot yet be resolved when the class is created.
To modify the annotations, it is best to create a wrapper annotate function
that calls the original annotate function, makes any necessary adjustments, and... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e79316fb-2602-4352-b0a8-f62682ad89bb | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,017 | supabase-export-v2 | da32733bcb9c3586 | format, which is used to automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if they are not supported directly, :term:`annotate functions <annotate function>` must provide the following attributes:
* A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not
raise a ... | trusted_official_docs | CPython Docs | format, which is used to automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if they are not supported directly, :term:`annotate functions <annotate function>` must provide the following attributes:
* A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not
raise a ... | format, which is used to automatically generate :attr:`~Format.STRING` or :attr:`~Format.FORWARDREF` if they are not supported directly, :term:`annotate functions <annotate function>` must provide the following attributes:
* A callable ``__call__`` with signature ``__call__(format, /) -> dict``, that does not
raise a ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e90a40ea-e97a-4c07-8281-0d1485164ff3 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,935 | supabase-export-v2 | cb9acc70c73d7020 | they do not support execution in this environment. This format is only used internally and should not be passed to the functions in this module.
.. attribute:: FORWARDREF
:value: 3 | trusted_official_docs | CPython Docs | they do not support execution in this environment. This format is only used internally and should not be passed to the functions in this module.
.. attribute:: FORWARDREF
:value: 3 | they do not support execution in this environment. This format is only used internally and should not be passed to the functions in this module.
.. attribute:: FORWARDREF
:value: 3 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
eb2f265a-8ef2-4f62-960c-465def6c45c9 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,930 | supabase-export-v2 | 37955297e2587125 | .. class:: Format
An :class:`~enum.IntEnum` describing the formats in which annotations
can be returned. Members 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. | trusted_official_docs | CPython Docs | .. class:: Format
An :class:`~enum.IntEnum` describing the formats in which annotations
can be returned. Members 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. | .. class:: Format
An :class:`~enum.IntEnum` describing the formats in which annotations
can be returned. Members 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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ed49e9fd-df47-48fc-8f7d-a0fb554858e6 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,005 | supabase-export-v2 | 2d16b4d4b9e7e60c | the annotations, it is best to create a wrapper annotate function that calls the original annotate function, makes any necessary adjustments, and returns the result.
Below is an example of a metaclass that filters out all :class:`typing.ClassVar`
annotations from the class and puts them in a separate attribute: | trusted_official_docs | CPython Docs | the annotations, it is best to create a wrapper annotate function that calls the original annotate function, makes any necessary adjustments, and returns the result.
Below is an example of a metaclass that filters out all :class:`typing.ClassVar`
annotations from the class and puts them in a separate attribute: | the annotations, it is best to create a wrapper annotate function that calls the original annotate function, makes any necessary adjustments, and returns the result.
Below is an example of a metaclass that filters out all :class:`typing.ClassVar`
annotations from the class and puts them in a separate attribute: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f03374a4-add0-449a-86d4-220dd4264d7d | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,962 | supabase-export-v2 | 35e57833bce51235 | in the other formats. This is a useful building block when implementing functionality that needs to partially evaluate annotations while a class is being constructed.
*owner* is the object that owns the annotation function, usually
a function, class, or module. If provided, it is used in the
:attr:`~Format.FORWARDREF... | trusted_official_docs | CPython Docs | in the other formats. This is a useful building block when implementing functionality that needs to partially evaluate annotations while a class is being constructed.
*owner* is the object that owns the annotation function, usually
a function, class, or module. If provided, it is used in the
:attr:`~Format.FORWARDREF... | in the other formats. This is a useful building block when implementing functionality that needs to partially evaluate annotations while a class is being constructed.
*owner* is the object that owns the annotation function, usually
a function, class, or module. If provided, it is used in the
:attr:`~Format.FORWARDREF... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f170f59e-db93-4b1f-b139-62a8f8878eb7 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,994 | supabase-export-v2 | 383012fa0ec28a32 | to :attr:`obj.__globals__ <function.__globals__>`, although if *obj* is a wrapped function (using :func:`functools.update_wrapper`) or a :class:`functools.partial` object, it is unwrapped until a non-wrapped function is found.
Calling :func:`!get_annotations` is best practice for accessing the
annotations dict of any ... | trusted_official_docs | CPython Docs | to :attr:`obj.__globals__ <function.__globals__>`, although if *obj* is a wrapped function (using :func:`functools.update_wrapper`) or a :class:`functools.partial` object, it is unwrapped until a non-wrapped function is found.
Calling :func:`!get_annotations` is best practice for accessing the
annotations dict of any ... | to :attr:`obj.__globals__ <function.__globals__>`, although if *obj* is a wrapped function (using :func:`functools.update_wrapper`) or a :class:`functools.partial` object, it is unwrapped until a non-wrapped function is found.
Calling :func:`!get_annotations` is best practice for accessing the
annotations dict of any ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f23909ac-be16-4c08-8953-6801adb54851 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,951 | supabase-export-v2 | 020b19da0b1f978c | created by other means may not have any information about their scope, so passing arguments to this method may be necessary to evaluate them successfully.
If no *owner*, *globals*, *locals*, or *type_params* are provided and the
:class:`~ForwardRef` does not contain information about its origin,
empty globals and loc... | trusted_official_docs | CPython Docs | created by other means may not have any information about their scope, so passing arguments to this method may be necessary to evaluate them successfully.
If no *owner*, *globals*, *locals*, or *type_params* are provided and the
:class:`~ForwardRef` does not contain information about its origin,
empty globals and loc... | created by other means may not have any information about their scope, so passing arguments to this method may be necessary to evaluate them successfully.
If no *owner*, *globals*, *locals*, or *type_params* are provided and the
:class:`~ForwardRef` does not contain information about its origin,
empty globals and loc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3fc781f-5963-409d-8d49-66de3d450a52 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,989 | supabase-export-v2 | f62805516719616d | This function handles several details for you:
* If *eval_str* is true, values of type :class:`!str` will
be un-stringized using :func:`eval`. This is intended
for use with stringized annotations
(``from __future__ import annotations``). It is an error
to set *eval_str* to true with formats other than :attr:`Format... | trusted_official_docs | CPython Docs | This function handles several details for you:
* If *eval_str* is true, values of type :class:`!str` will
be un-stringized using :func:`eval`. This is intended
for use with stringized annotations
(``from __future__ import annotations``). It is an error
to set *eval_str* to true with formats other than :attr:`Format... | This function handles several details for you:
* If *eval_str* is true, values of type :class:`!str` will
be un-stringized using :func:`eval`. This is intended
for use with stringized annotations
(``from __future__ import annotations``). It is an error
to set *eval_str* to true with formats other than :attr:`Format... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f55f9fee-4993-4a6b-aa8a-9a5866e1351e | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,937 | supabase-export-v2 | 8931eaff10e63251 | 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:: STRING
:value: 4 | trusted_official_docs | CPython Docs | 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:: STRING
:value: 4 | 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:: STRING
:value: 4 | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f5f1b999-993d-4b44-acb0-b1eb2ce82c97 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,009 | supabase-export-v2 | 8ff99067b0e8113c | annotate, format=annotationlib.Format.FORWARDREF ) classvar_keys = { key for key, value in annotations.items() if typing.get_origin(value) is typing.ClassVar } classvars = {key: annotations[key] for key in classvar_keys}
def wrapped_annotate(format):
annos = annotationlib.call_annotate_function(annotate, format, owner... | trusted_official_docs | CPython Docs | annotate, format=annotationlib.Format.FORWARDREF ) classvar_keys = { key for key, value in annotations.items() if typing.get_origin(value) is typing.ClassVar } classvars = {key: annotations[key] for key in classvar_keys}
def wrapped_annotate(format):
annos = annotationlib.call_annotate_function(annotate, format, owner... | annotate, format=annotationlib.Format.FORWARDREF ) classvar_keys = { key for key, value in annotations.items() if typing.get_origin(value) is typing.ClassVar } classvars = {key: annotations[key] for key in classvar_keys}
def wrapped_annotate(format):
annos = annotationlib.call_annotate_function(annotate, format, owner... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f62e6d16-c95a-4ab0-a99f-1571fcc0d1d5 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 28,939 | supabase-export-v2 | 077adfec1fef480a | 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.
The exact values of these strings may change in future versions of Python. | trusted_official_docs | CPython Docs | 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.
The exact values of these strings may change in future versions of Python. | 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.
The exact values of these strings may change in future versions of Python. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb35d730-3f2d-45c5-94c6-39b6c90c5a82 | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,044 | supabase-export-v2 | c7380bdc1dd8008a | is not a constant) * :class:`ast.Subscript` (assuming the value is not a constant) * :class:`ast.Starred` (``*`` unpacking) * :class:`ast.Name` * :class:`ast.List` * :class:`ast.Tuple` * :class:`ast.Slice`
The following are unsupported, but throw an informative error when encountered by the
stringifier: | trusted_official_docs | CPython Docs | is not a constant) * :class:`ast.Subscript` (assuming the value is not a constant) * :class:`ast.Starred` (``*`` unpacking) * :class:`ast.Name` * :class:`ast.List` * :class:`ast.Tuple` * :class:`ast.Slice`
The following are unsupported, but throw an informative error when encountered by the
stringifier: | is not a constant) * :class:`ast.Subscript` (assuming the value is not a constant) * :class:`ast.Starred` (``*`` unpacking) * :class:`ast.Name` * :class:`ast.List` * :class:`ast.Tuple` * :class:`ast.Slice`
The following are unsupported, but throw an informative error when encountered by the
stringifier: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fbfdd2e3-b571-41e9-b5f4-ae05d192fd2c | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,032 | supabase-export-v2 | 8db2ed5a88a5ff9b | approximate the source code of the annotation, but the implementation strategy used means that it is not always possible to recover the exact source code.
First, the stringifier of course cannot recover any information that is not present in
the compiled code, including comments, whitespace, parenthesization, and opera... | trusted_official_docs | CPython Docs | approximate the source code of the annotation, but the implementation strategy used means that it is not always possible to recover the exact source code.
First, the stringifier of course cannot recover any information that is not present in
the compiled code, including comments, whitespace, parenthesization, and opera... | approximate the source code of the annotation, but the implementation strategy used means that it is not always possible to recover the exact source code.
First, the stringifier of course cannot recover any information that is not present in
the compiled code, including comments, whitespace, parenthesization, and opera... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd32ad92-7f2e-4442-902c-d85e9e29ccef | CPython Docs | file://datasets/cpython/Doc/library/annotationlib.rst | unknown | f9b28c84-765e-4bca-97ba-c00da5ac5278 | 29,031 | supabase-export-v2 | 805fe26328d15f36 | Limitations of the ``STRING`` format ------------------------------------
The :attr:`~Format.STRING` format is meant to approximate the source code
of the annotation, but the implementation strategy used means that it is not
always possible to recover the exact source code. | trusted_official_docs | CPython Docs | Limitations of the ``STRING`` format ------------------------------------
The :attr:`~Format.STRING` format is meant to approximate the source code
of the annotation, but the implementation strategy used means that it is not
always possible to recover the exact source code. | Limitations of the ``STRING`` format ------------------------------------
The :attr:`~Format.STRING` format is meant to approximate the source code
of the annotation, but the implementation strategy used means that it is not
always possible to recover the exact source code. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
003b23b7-c02f-490b-b7c8-4dabf3407020 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,336 | supabase-export-v2 | 757c28eeb13c142a | indent=4)) Module( body=[ Try( body=[ Expr( value=Constant(value=Ellipsis))], handlers=[ ExceptHandler( type=Name(id='Exception'), body=[ Expr( value=Constant(value=Ellipsis))]), ExceptHandler( type=Name(id='OtherException'), name='e', body=[ Expr( value=Constant(value=Ellipsis))])], orelse=[ Expr( value=Constant(value... | trusted_official_docs | CPython Docs | indent=4)) Module( body=[ Try( body=[ Expr( value=Constant(value=Ellipsis))], handlers=[ ExceptHandler( type=Name(id='Exception'), body=[ Expr( value=Constant(value=Ellipsis))]), ExceptHandler( type=Name(id='OtherException'), name='e', body=[ Expr( value=Constant(value=Ellipsis))])], orelse=[ Expr( value=Constant(value... | indent=4)) Module( body=[ Try( body=[ Expr( value=Constant(value=Ellipsis))], handlers=[ ExceptHandler( type=Name(id='Exception'), body=[ Expr( value=Constant(value=Ellipsis))]), ExceptHandler( type=Name(id='OtherException'), name='e', body=[ Expr( value=Constant(value=Ellipsis))])], orelse=[ Expr( value=Constant(value... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
00f152de-1ac4-4603-ba55-5e78b0478d3c | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,562 | supabase-export-v2 | caf10d0fe79effa5 | .. function:: dump(node, annotate_fields=True, include_attributes=False, *, color=False, indent=None, show_empty=False)
Return a formatted dump of the tree in *node*. This is mainly useful for
debugging purposes. If *annotate_fields* is true (by default),
the returned string will show the names and the values for fie... | trusted_official_docs | CPython Docs | .. function:: dump(node, annotate_fields=True, include_attributes=False, *, color=False, indent=None, show_empty=False)
Return a formatted dump of the tree in *node*. This is mainly useful for
debugging purposes. If *annotate_fields* is true (by default),
the returned string will show the names and the values for fie... | .. function:: dump(node, annotate_fields=True, include_attributes=False, *, color=False, indent=None, show_empty=False)
Return a formatted dump of the tree in *node*. This is mainly useful for
debugging purposes. If *annotate_fields* is true (by default),
the returned string will show the names and the values for fie... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
059286ac-6aa4-4a3c-ade1-4c54c82b0ddc | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,103 | supabase-export-v2 | 4bd888cd4e7ce611 | .. deprecated-removed:: 3.13 3.15
Previous versions of Python allowed the creation of AST nodes that were missing
required fields. Similarly, AST node constructors allowed arbitrary keyword
arguments that were set as attributes of the AST node, even if they did not
match any of the fields of the AST node. These case... | trusted_official_docs | CPython Docs | .. deprecated-removed:: 3.13 3.15
Previous versions of Python allowed the creation of AST nodes that were missing
required fields. Similarly, AST node constructors allowed arbitrary keyword
arguments that were set as attributes of the AST node, even if they did not
match any of the fields of the AST node. These case... | .. deprecated-removed:: 3.13 3.15
Previous versions of Python allowed the creation of AST nodes that were missing
required fields. Similarly, AST node constructors allowed arbitrary keyword
arguments that were set as attributes of the AST node, even if they did not
match any of the fields of the AST node. These case... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
06410758-43a8-4afa-90d7-ac82b4cd72de | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,087 | supabase-export-v2 | 3d4ceb76af1bd65d | assigned as attributes of these names. * If there are keyword arguments, they will set the attributes of the same names to the given values.
For example, to create and populate an :class:`ast.UnaryOp` node, you could
use :: | trusted_official_docs | CPython Docs | assigned as attributes of these names. * If there are keyword arguments, they will set the attributes of the same names to the given values.
For example, to create and populate an :class:`ast.UnaryOp` node, you could
use :: | assigned as attributes of these names. * If there are keyword arguments, they will set the attributes of the same names to the given values.
For example, to create and populate an :class:`ast.UnaryOp` node, you could
use :: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
06529396-dada-4354-8dde-217c4285072c | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,410 | supabase-export-v2 | d7c5f70758bb17ea | .. doctest::
>>> print(ast.dump(ast.parse("""
... match x:
... case [x] | (y):
... ... ... """), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchOr(
patterns=[
MatchSequence(
patterns=[
MatchAs(name='x')]),
MatchAs(name='y')]),
body=[
Expr(
value=Constant(value=... | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse("""
... match x:
... case [x] | (y):
... ... ... """), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchOr(
patterns=[
MatchSequence(
patterns=[
MatchAs(name='x')]),
MatchAs(name='y')]),
body=[
Expr(
value=Constant(value=... | .. doctest::
>>> print(ast.dump(ast.parse("""
... match x:
... case [x] | (y):
... ... ... """), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchOr(
patterns=[
MatchSequence(
patterns=[
MatchAs(name='x')]),
MatchAs(name='y')]),
body=[
Expr(
value=Constant(value=... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0d39ddf7-c9a9-4da8-9d10-f452434d52ee | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,376 | supabase-export-v2 | f99ef329d9156576 | .. class:: MatchSequence(patterns)
A match sequence pattern. ``patterns`` contains the patterns to be matched
against the subject elements if the subject is a sequence. Matches a variable
length sequence if one of the subpatterns is a ``MatchStar`` node, otherwise
matches a fixed length sequence. | trusted_official_docs | CPython Docs | .. class:: MatchSequence(patterns)
A match sequence pattern. ``patterns`` contains the patterns to be matched
against the subject elements if the subject is a sequence. Matches a variable
length sequence if one of the subpatterns is a ``MatchStar`` node, otherwise
matches a fixed length sequence. | .. class:: MatchSequence(patterns)
A match sequence pattern. ``patterns`` contains the patterns to be matched
against the subject elements if the subject is a sequence. Matches a variable
length sequence if one of the subpatterns is a ``MatchStar`` node, otherwise
matches a fixed length sequence. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0e0572bf-1541-42fb-9d47-f976ad4715a1 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,063 | supabase-export-v2 | c4602a97837a24dc | --------------
The :mod:`!ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with each
Python release; this module helps to find out programmatically what the current
grammar looks like. | trusted_official_docs | CPython Docs | --------------
The :mod:`!ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with each
Python release; this module helps to find out programmatically what the current
grammar looks like. | --------------
The :mod:`!ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with each
Python release; this module helps to find out programmatically what the current
grammar looks like. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
147ca51f-4493-4b03-a16a-fb6ee96ee898 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,254 | supabase-export-v2 | 343b533c85e1e76a | >>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', mode='eval'), ...
indent=4)) # generator comprehension
Expression(
body=GeneratorExp(
elt=BinOp(
left=Name(id='n'),
op=Pow(),
right=Constant(value=2)),
generators=[
comprehension(
target=Name(id='n', ctx=Store()),
iter=Name(id='it'),
ifs=[
Co... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', mode='eval'), ...
indent=4)) # generator comprehension
Expression(
body=GeneratorExp(
elt=BinOp(
left=Name(id='n'),
op=Pow(),
right=Constant(value=2)),
generators=[
comprehension(
target=Name(id='n', ctx=Store()),
iter=Name(id='it'),
ifs=[
Co... | >>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', mode='eval'), ...
indent=4)) # generator comprehension
Expression(
body=GeneratorExp(
elt=BinOp(
left=Name(id='n'),
op=Pow(),
right=Constant(value=2)),
generators=[
comprehension(
target=Name(id='n', ctx=Store()),
iter=Name(id='it'),
ifs=[
Co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
15c24fc1-72e6-4be2-a874-33cdc33951f4 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,215 | supabase-export-v2 | e9da21035f8e709a | * ``args`` holds a list of the arguments passed by position. * ``keywords`` holds a list of :class:`.keyword` objects representing arguments passed by keyword.
The ``args`` and ``keywords`` arguments are optional and default to empty lists. | trusted_official_docs | CPython Docs | * ``args`` holds a list of the arguments passed by position. * ``keywords`` holds a list of :class:`.keyword` objects representing arguments passed by keyword.
The ``args`` and ``keywords`` arguments are optional and default to empty lists. | * ``args`` holds a list of the arguments passed by position. * ``keywords`` holds a list of :class:`.keyword` objects representing arguments passed by keyword.
The ``args`` and ``keywords`` arguments are optional and default to empty lists. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
18b61e12-ef05-4cf4-8115-ff9df5e4d695 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,255 | supabase-export-v2 | 4f668d394598ebb5 | Expression( body=GeneratorExp( elt=BinOp( left=Name(id='n'), op=Pow(), right=Constant(value=2)), generators=[ comprehension( target=Name(id='n', ctx=Store()), iter=Name(id='it'), ifs=[ Compare( left=Name(id='n'), ops=[ Gt()], comparators=[ Constant(value=5)]), Compare( left=Name(id='n'), ops=[ Lt()], comparators=[ Cons... | trusted_official_docs | CPython Docs | Expression( body=GeneratorExp( elt=BinOp( left=Name(id='n'), op=Pow(), right=Constant(value=2)), generators=[ comprehension( target=Name(id='n', ctx=Store()), iter=Name(id='it'), ifs=[ Compare( left=Name(id='n'), ops=[ Gt()], comparators=[ Constant(value=5)]), Compare( left=Name(id='n'), ops=[ Lt()], comparators=[ Cons... | Expression( body=GeneratorExp( elt=BinOp( left=Name(id='n'), op=Pow(), right=Constant(value=2)), generators=[ comprehension( target=Name(id='n', ctx=Store()), iter=Name(id='it'), ifs=[ Compare( left=Name(id='n'), ops=[ Gt()], comparators=[ Constant(value=5)]), Compare( left=Name(id='n'), ops=[ Lt()], comparators=[ Cons... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
19064955-010d-48ce-b36e-141a5f7c7bb6 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,518 | supabase-export-v2 | 2756bc833fbd68f4 | .. function:: get_docstring(node, clean=True)
Return the docstring of the given *node* (which must be a
:class:`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`,
or :class:`Module` node), or ``None`` if it has no docstring. If *clean* is true, clean up the docstring's indentation with
:func:`inspect.cleand... | trusted_official_docs | CPython Docs | .. function:: get_docstring(node, clean=True)
Return the docstring of the given *node* (which must be a
:class:`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`,
or :class:`Module` node), or ``None`` if it has no docstring. If *clean* is true, clean up the docstring's indentation with
:func:`inspect.cleand... | .. function:: get_docstring(node, clean=True)
Return the docstring of the given *node* (which must be a
:class:`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`,
or :class:`Module` node), or ``None`` if it has no docstring. If *clean* is true, clean up the docstring's indentation with
:func:`inspect.cleand... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
192e803f-b645-404e-8c13-6318028c74bf | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,158 | supabase-export-v2 | 8300055c4aac3e9b | * -1: no conversion * 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion * 114 (``ord('r')``): ``!r`` :func:`repr` conversion * 115 (``ord('s')``): ``!s`` :func:`string <str>` conversion
This has the same meaning as ``FormattedValue.conversion``. * ``format_spec`` is a :class:`JoinedStr` node representing the f... | trusted_official_docs | CPython Docs | * -1: no conversion * 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion * 114 (``ord('r')``): ``!r`` :func:`repr` conversion * 115 (``ord('s')``): ``!s`` :func:`string <str>` conversion
This has the same meaning as ``FormattedValue.conversion``. * ``format_spec`` is a :class:`JoinedStr` node representing the f... | * -1: no conversion * 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion * 114 (``ord('r')``): ``!r`` :func:`repr` conversion * 115 (``ord('s')``): ``!s`` :func:`string <str>` conversion
This has the same meaning as ``FormattedValue.conversion``. * ``format_spec`` is a :class:`JoinedStr` node representing the f... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1aceb56c-a3d8-45c8-bc82-d1431697b369 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,160 | supabase-export-v2 | fbe019c8272e12ad | .. class:: List(elts, ctx) Tuple(elts, ctx)
A list or tuple. ``elts`` holds a list of nodes representing the elements. ``ctx`` is :class:`Store` if the container is an assignment target (i.e. ``(x,y)=something``), and :class:`Load` otherwise. | trusted_official_docs | CPython Docs | .. class:: List(elts, ctx) Tuple(elts, ctx)
A list or tuple. ``elts`` holds a list of nodes representing the elements. ``ctx`` is :class:`Store` if the container is an assignment target (i.e. ``(x,y)=something``), and :class:`Load` otherwise. | .. class:: List(elts, ctx) Tuple(elts, ctx)
A list or tuple. ``elts`` holds a list of nodes representing the elements. ``ctx`` is :class:`Store` if the container is an assignment target (i.e. ``(x,y)=something``), and :class:`Load` otherwise. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1bd1ed0a-ded8-42a6-bd2c-edbfda7a17c4 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,387 | supabase-export-v2 | e8ec52a8e1df66e3 | an optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as described in the match statement documentation.
This pattern succeeds if the subject is a mapping, all evaluated key
expressions are present in the mapping, and the value corresponding to each
... | trusted_official_docs | CPython Docs | an optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as described in the match statement documentation.
This pattern succeeds if the subject is a mapping, all evaluated key
expressions are present in the mapping, and the value corresponding to each
... | an optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as described in the match statement documentation.
This pattern succeeds if the subject is a mapping, all evaluated key
expressions are present in the mapping, and the value corresponding to each
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1cdc4591-2e22-4a28-b003-0e4de4de0dd4 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,322 | supabase-export-v2 | 3a693c9342dff452 | .. doctest::
>>> print(ast.dump(ast.parse("""
... for x in y:
... ... ... else:
... ... ... """), indent=4))
Module(
body=[
For(
target=Name(id='x', ctx=Store()),
iter=Name(id='y'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(
value=Constant(value=Ellipsis))])]) | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse("""
... for x in y:
... ... ... else:
... ... ... """), indent=4))
Module(
body=[
For(
target=Name(id='x', ctx=Store()),
iter=Name(id='y'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(
value=Constant(value=Ellipsis))])]) | .. doctest::
>>> print(ast.dump(ast.parse("""
... for x in y:
... ... ... else:
... ... ... """), indent=4))
Module(
body=[
For(
target=Name(id='x', ctx=Store()),
iter=Name(id='y'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(
value=Constant(value=Ellipsis))])]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f117846-df0a-40be-bd20-af5f5b4840a7 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,272 | supabase-export-v2 | 622cf6a94ba5e966 | >>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation Module( body=[ AnnAssign( target=Attribute( value=Name(id='a'), attr='b', ctx=Store()), annotation=Name(id='int'), simple=0)])
>>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript annotation
Module(
body=[
AnnAssign(
target=Sub... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation Module( body=[ AnnAssign( target=Attribute( value=Name(id='a'), attr='b', ctx=Store()), annotation=Name(id='int'), simple=0)])
>>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript annotation
Module(
body=[
AnnAssign(
target=Sub... | >>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation Module( body=[ AnnAssign( target=Attribute( value=Name(id='a'), attr='b', ctx=Store()), annotation=Name(id='int'), simple=0)])
>>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript annotation
Module(
body=[
AnnAssign(
target=Sub... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1f9da28a-022b-4982-87fc-f4bb06c79399 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,616 | supabase-export-v2 | 876e7afdf832331a | `Green Tree Snakes <https://greentreesnakes.readthedocs.io/>`_, an external documentation resource, has good details on working with Python ASTs.
`ASTTokens <https://asttokens.readthedocs.io/en/latest/user-guide.html>`_
annotates Python ASTs with the positions of tokens and text in the source
code that generated them... | trusted_official_docs | CPython Docs | `Green Tree Snakes <https://greentreesnakes.readthedocs.io/>`_, an external documentation resource, has good details on working with Python ASTs.
`ASTTokens <https://asttokens.readthedocs.io/en/latest/user-guide.html>`_
annotates Python ASTs with the positions of tokens and text in the source
code that generated them... | `Green Tree Snakes <https://greentreesnakes.readthedocs.io/>`_, an external documentation resource, has good details on working with Python ASTs.
`ASTTokens <https://asttokens.readthedocs.io/en/latest/user-guide.html>`_
annotates Python ASTs with the positions of tokens and text in the source
code that generated them... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1ffa7fb8-6fc3-43af-aa2e-88b1476ba866 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,126 | supabase-export-v2 | dc5e1740b612c7e1 | an old-style type comments for functions, as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``"func_type"``.
Such type comments would look like this:: | trusted_official_docs | CPython Docs | an old-style type comments for functions, as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``"func_type"``.
Such type comments would look like this:: | an old-style type comments for functions, as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``"func_type"``.
Such type comments would look like this:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
20ee2c95-552b-4790-a579-c61f87f4e1b5 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,408 | supabase-export-v2 | a57705f6935bdd4a | .. class:: MatchOr(patterns)
A match "or-pattern". An or-pattern matches each of its subpatterns in turn
to the subject, until one succeeds. The or-pattern is then deemed to
succeed. If none of the subpatterns succeed the or-pattern fails. The
``patterns`` attribute contains a list of match pattern nodes that will b... | trusted_official_docs | CPython Docs | .. class:: MatchOr(patterns)
A match "or-pattern". An or-pattern matches each of its subpatterns in turn
to the subject, until one succeeds. The or-pattern is then deemed to
succeed. If none of the subpatterns succeed the or-pattern fails. The
``patterns`` attribute contains a list of match pattern nodes that will b... | .. class:: MatchOr(patterns)
A match "or-pattern". An or-pattern matches each of its subpatterns in turn
to the subject, until one succeeds. The or-pattern is then deemed to
succeed. If none of the subpatterns succeed the or-pattern fails. The
``patterns`` attribute contains a list of match pattern nodes that will b... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
23ff2f53-b7f1-4cd7-95ba-1c0677ecdcec | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,617 | supabase-export-v2 | 1b37ab548b2c8ad7 | ASTs with the positions of tokens and text in the source code that generated them. This is helpful for tools that make source code transformations.
`leoAst.py <https://leo-editor.github.io/leo-editor/appendices.html#leoast-py>`_
unifies the
token-based and parse-tree-based views of python programs by inserting
two-w... | trusted_official_docs | CPython Docs | ASTs with the positions of tokens and text in the source code that generated them. This is helpful for tools that make source code transformations.
`leoAst.py <https://leo-editor.github.io/leo-editor/appendices.html#leoast-py>`_
unifies the
token-based and parse-tree-based views of python programs by inserting
two-w... | ASTs with the positions of tokens and text in the source code that generated them. This is helpful for tools that make source code transformations.
`leoAst.py <https://leo-editor.github.io/leo-editor/appendices.html#leoast-py>`_
unifies the
token-based and parse-tree-based views of python programs by inserting
two-w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
24b13fb2-3e93-4aa3-b00e-20b9a542d8f1 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,169 | supabase-export-v2 | 284db489698c5109 | and ``values`` hold lists of nodes representing the keys and the values respectively, in matching order (what would be returned when calling :code:`dictionary.keys()` and :code:`dictionary.values()`).
When doing dictionary unpacking using dictionary literals the expression to be
expanded goes in the ``values`` list, w... | trusted_official_docs | CPython Docs | and ``values`` hold lists of nodes representing the keys and the values respectively, in matching order (what would be returned when calling :code:`dictionary.keys()` and :code:`dictionary.values()`).
When doing dictionary unpacking using dictionary literals the expression to be
expanded goes in the ``values`` list, w... | and ``values`` hold lists of nodes representing the keys and the values respectively, in matching order (what would be returned when calling :code:`dictionary.keys()` and :code:`dictionary.values()`).
When doing dictionary unpacking using dictionary literals the expression to be
expanded goes in the ``values`` list, w... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
25f55298-d3ee-43c8-94dc-230bb306f45b | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,076 | supabase-export-v2 | bdd6cdfd1023a2cc | one attribute for each child node, of the type as defined in the grammar. For example, :class:`ast.BinOp` instances have an attribute :attr:`left` of type :class:`ast.expr`.
If these attributes are marked as optional in the grammar (using a
question mark), the value might be ``None``. If the attributes can have
zero-... | trusted_official_docs | CPython Docs | one attribute for each child node, of the type as defined in the grammar. For example, :class:`ast.BinOp` instances have an attribute :attr:`left` of type :class:`ast.expr`.
If these attributes are marked as optional in the grammar (using a
question mark), the value might be ``None``. If the attributes can have
zero-... | one attribute for each child node, of the type as defined in the grammar. For example, :class:`ast.BinOp` instances have an attribute :attr:`left` of type :class:`ast.expr`.
If these attributes are marked as optional in the grammar (using a
question mark), the value might be ``None``. If the attributes can have
zero-... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
274ce75f-860b-4475-b6f0-a7cddd50e6c7 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,271 | supabase-export-v2 | fdfeaf0438000d6c | >>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with parenthesis Module( body=[ AnnAssign( target=Name(id='a', ctx=Store()), annotation=Name(id='int'), value=Constant(value=1), simple=0)])
>>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation
Module(
body=[
AnnAssign(
tar... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with parenthesis Module( body=[ AnnAssign( target=Name(id='a', ctx=Store()), annotation=Name(id='int'), value=Constant(value=1), simple=0)])
>>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation
Module(
body=[
AnnAssign(
tar... | >>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with parenthesis Module( body=[ AnnAssign( target=Name(id='a', ctx=Store()), annotation=Name(id='int'), value=Constant(value=1), simple=0)])
>>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation
Module(
body=[
AnnAssign(
tar... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
28ca151d-37bd-4966-9d45-0155120a57aa | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,591 | supabase-export-v2 | 444360ccfb199ed3 | .. versionchanged:: next The output is now syntax highlighted by default. This can be :ref:`controlled using environment variables <using-on-controlling-color>`.
The :mod:`!ast` module can be executed as a script from the command line. It is as simple as: | trusted_official_docs | CPython Docs | .. versionchanged:: next The output is now syntax highlighted by default. This can be :ref:`controlled using environment variables <using-on-controlling-color>`.
The :mod:`!ast` module can be executed as a script from the command line. It is as simple as: | .. versionchanged:: next The output is now syntax highlighted by default. This can be :ref:`controlled using environment variables <using-on-controlling-color>`.
The :mod:`!ast` module can be executed as a script from the command line. It is as simple as: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2defc71b-1c90-4890-9185-66b99612f48b | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,064 | supabase-export-v2 | 11393248be6a75c0 | syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like.
An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as
a flag to the :func:`compile` built-in function, or using the :func:`pars... | trusted_official_docs | CPython Docs | syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like.
An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as
a flag to the :func:`compile` built-in function, or using the :func:`pars... | syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like.
An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as
a flag to the :func:`compile` built-in function, or using the :func:`pars... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f82646d-179c-4da0-b0d1-75d340fd1cbb | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,394 | supabase-export-v2 | 2f709471a26f7f73 | attributes to be matched (specified as keyword arguments in the class pattern), ``kwd_patterns`` are the corresponding patterns (specified as keyword values in the class pattern).
This pattern succeeds if the subject is an instance of the nominated class,
all positional patterns match the corresponding class-defined a... | trusted_official_docs | CPython Docs | attributes to be matched (specified as keyword arguments in the class pattern), ``kwd_patterns`` are the corresponding patterns (specified as keyword values in the class pattern).
This pattern succeeds if the subject is an instance of the nominated class,
all positional patterns match the corresponding class-defined a... | attributes to be matched (specified as keyword arguments in the class pattern), ``kwd_patterns`` are the corresponding patterns (specified as keyword values in the class pattern).
This pattern succeeds if the subject is an instance of the nominated class,
all positional patterns match the corresponding class-defined a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
301371bb-ef63-4bdf-b31d-898accff5027 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,247 | supabase-export-v2 | 5ac7fbba77664fa1 | indent=4, ... )) Expression( body=ListComp( elt=Name(id='x'), generators=[ comprehension( target=Name(id='x', ctx=Store()), iter=Name(id='numbers'), is_async=0)])) >>> print(ast.dump( ... ast.parse('{x: x**2 for x in numbers}', mode='eval'), ... indent=4, ...
))
Expression(
body=DictComp(
key=Name(id='x'),
value=Bi... | trusted_official_docs | CPython Docs | indent=4, ... )) Expression( body=ListComp( elt=Name(id='x'), generators=[ comprehension( target=Name(id='x', ctx=Store()), iter=Name(id='numbers'), is_async=0)])) >>> print(ast.dump( ... ast.parse('{x: x**2 for x in numbers}', mode='eval'), ... indent=4, ...
))
Expression(
body=DictComp(
key=Name(id='x'),
value=Bi... | indent=4, ... )) Expression( body=ListComp( elt=Name(id='x'), generators=[ comprehension( target=Name(id='x', ctx=Store()), iter=Name(id='numbers'), is_async=0)])) >>> print(ast.dump( ... ast.parse('{x: x**2 for x in numbers}', mode='eval'), ... indent=4, ...
))
Expression(
body=DictComp(
key=Name(id='x'),
value=Bi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3286916d-079a-4e51-a46a-75b34f37d849 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,564 | supabase-export-v2 | 528ac6953c3d5745 | If *color* is ``True``, the returned string is syntax highlighted using ANSI escape sequences. If ``False`` (the default), colored output is always disabled.
If *indent* is a non-negative integer or string, then the tree will be
pretty-printed with that indent level. An indent level
of 0, negative, or ``""`` will onl... | trusted_official_docs | CPython Docs | If *color* is ``True``, the returned string is syntax highlighted using ANSI escape sequences. If ``False`` (the default), colored output is always disabled.
If *indent* is a non-negative integer or string, then the tree will be
pretty-printed with that indent level. An indent level
of 0, negative, or ``""`` will onl... | If *color* is ``True``, the returned string is syntax highlighted using ANSI escape sequences. If ``False`` (the default), colored output is always disabled.
If *indent* is a non-negative integer or string, then the tree will be
pretty-printed with that indent level. An indent level
of 0, negative, or ``""`` will onl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
366f44df-b86d-4571-b358-80fb7809b28a | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,135 | supabase-export-v2 | 210483826b48af29 | the Python object it represents. The values represented can be instances of :class:`str`, :class:`bytes`, :class:`int`, :class:`float`, :class:`complex`, and :class:`bool`, and the constants :data:`None` and :data:`Ellipsis`.
The ``kind`` attribute is an optional string. For string literals with a
``u`` prefix, ``kind... | trusted_official_docs | CPython Docs | the Python object it represents. The values represented can be instances of :class:`str`, :class:`bytes`, :class:`int`, :class:`float`, :class:`complex`, and :class:`bool`, and the constants :data:`None` and :data:`Ellipsis`.
The ``kind`` attribute is an optional string. For string literals with a
``u`` prefix, ``kind... | the Python object it represents. The values represented can be instances of :class:`str`, :class:`bytes`, :class:`int`, :class:`float`, :class:`complex`, and :class:`bool`, and the constants :data:`None` and :data:`Ellipsis`.
The ``kind`` attribute is an optional string. For string literals with a
``u`` prefix, ``kind... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3b702c80-df4a-4049-be4d-fa667c22f997 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,383 | supabase-export-v2 | 8e1c861447052238 | >>> print(ast.dump(ast.parse(""" ... match x: ... case [1, 2, *rest]: ... ... ... case [*_]: ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchSequence(
patterns=[
MatchValue(
value=Constant(value=1)),
MatchValue(
value=Constant(value=2)),
MatchStar(n... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse(""" ... match x: ... case [1, 2, *rest]: ... ... ... case [*_]: ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchSequence(
patterns=[
MatchValue(
value=Constant(value=1)),
MatchValue(
value=Constant(value=2)),
MatchStar(n... | >>> print(ast.dump(ast.parse(""" ... match x: ... case [1, 2, *rest]: ... ... ... case [*_]: ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchSequence(
patterns=[
MatchValue(
value=Constant(value=1)),
MatchValue(
value=Constant(value=2)),
MatchStar(n... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d0d7aec-4855-4bcc-bae0-e848cd745372 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,253 | supabase-export-v2 | f1d06a8b664013dd | mode='eval'), ... indent=4)) # Multiple comprehensions in one. Expression( body=ListComp( elt=Call( func=Name(id='ord'), args=[ Name(id='c')]), generators=[ comprehension( target=Name(id='line', ctx=Store()), iter=Name(id='file'), is_async=0), comprehension( target=Name(id='c', ctx=Store()), iter=Name(id='line'), is_as... | trusted_official_docs | CPython Docs | mode='eval'), ... indent=4)) # Multiple comprehensions in one. Expression( body=ListComp( elt=Call( func=Name(id='ord'), args=[ Name(id='c')]), generators=[ comprehension( target=Name(id='line', ctx=Store()), iter=Name(id='file'), is_async=0), comprehension( target=Name(id='c', ctx=Store()), iter=Name(id='line'), is_as... | mode='eval'), ... indent=4)) # Multiple comprehensions in one. Expression( body=ListComp( elt=Call( func=Name(id='ord'), args=[ Name(id='c')]), generators=[ comprehension( target=Name(id='line', ctx=Store()), iter=Name(id='file'), is_async=0), comprehension( target=Name(id='c', ctx=Store()), iter=Name(id='line'), is_as... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3dc44abc-9d9f-4215-aef9-c55994770d09 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,342 | supabase-export-v2 | d316dfbe7382e7ed | .. class:: ExceptHandler(type, name, body)
A single ``except`` clause. ``type`` is the exception type it will match,
typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` clause). ``name`` is a raw string for the name to hold the exception, or ``None`` if
the clause doesn't have ``as foo``. ``body``... | trusted_official_docs | CPython Docs | .. class:: ExceptHandler(type, name, body)
A single ``except`` clause. ``type`` is the exception type it will match,
typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` clause). ``name`` is a raw string for the name to hold the exception, or ``None`` if
the clause doesn't have ``as foo``. ``body``... | .. class:: ExceptHandler(type, name, body)
A single ``except`` clause. ``type`` is the exception type it will match,
typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` clause). ``name`` is a raw string for the name to hold the exception, or ``None`` if
the clause doesn't have ``as foo``. ``body``... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3eeac4cf-685e-4e63-85e3-222fd8ff7594 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,267 | supabase-export-v2 | a6b52592f695b561 | be a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. ``annotation`` is the annotation, such as a :class:`Constant` or :class:`Name` node. ``value`` is a single optional node.
``simple`` is always either 0 (indicating a "complex" target) or 1
(indicating a "simple" target). A "simple" target consists sole... | trusted_official_docs | CPython Docs | be a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. ``annotation`` is the annotation, such as a :class:`Constant` or :class:`Name` node. ``value`` is a single optional node.
``simple`` is always either 0 (indicating a "complex" target) or 1
(indicating a "simple" target). A "simple" target consists sole... | be a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. ``annotation`` is the annotation, such as a :class:`Constant` or :class:`Name` node. ``value`` is a single optional node.
``simple`` is always either 0 (indicating a "complex" target) or 1
(indicating a "simple" target). A "simple" target consists sole... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4199c3a5-49ee-4144-b583-dfddd62ad67f | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,345 | supabase-export-v2 | a4a0316e575e865b | a + 1 ... except TypeError: ... pass ... """), indent=4)) Module( body=[ Try( body=[ Expr( value=BinOp( left=Name(id='a'), op=Add(), right=Constant(value=1)))], handlers=[ ExceptHandler( type=Name(id='TypeError'), body=[ Pass()])])])
.. class:: With(items, body, type_comment) | trusted_official_docs | CPython Docs | a + 1 ... except TypeError: ... pass ... """), indent=4)) Module( body=[ Try( body=[ Expr( value=BinOp( left=Name(id='a'), op=Add(), right=Constant(value=1)))], handlers=[ ExceptHandler( type=Name(id='TypeError'), body=[ Pass()])])])
.. class:: With(items, body, type_comment) | a + 1 ... except TypeError: ... pass ... """), indent=4)) Module( body=[ Try( body=[ Expr( value=BinOp( left=Name(id='a'), op=Add(), right=Constant(value=1)))], handlers=[ ExceptHandler( type=Name(id='TypeError'), body=[ Pass()])])])
.. class:: With(items, body, type_comment) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
42be0a54-194d-4b09-938f-a8b78a6823b5 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,352 | supabase-export-v2 | 43f704b656923f89 | .. doctest::
>>> print(ast.dump(ast.parse("""\
... with a as b, c as d:
... something(b, d)
... """), indent=4))
Module(
body=[
With(
items=[
withitem(
context_expr=Name(id='a'),
optional_vars=Name(id='b', ctx=Store())),
withitem(
context_expr=Name(id='c'),
optional_vars=Name(id='d', ctx=Store()))],
body=... | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse("""\
... with a as b, c as d:
... something(b, d)
... """), indent=4))
Module(
body=[
With(
items=[
withitem(
context_expr=Name(id='a'),
optional_vars=Name(id='b', ctx=Store())),
withitem(
context_expr=Name(id='c'),
optional_vars=Name(id='d', ctx=Store()))],
body=... | .. doctest::
>>> print(ast.dump(ast.parse("""\
... with a as b, c as d:
... something(b, d)
... """), indent=4))
Module(
body=[
With(
items=[
withitem(
context_expr=Name(id='a'),
optional_vars=Name(id='b', ctx=Store())),
withitem(
context_expr=Name(id='c'),
optional_vars=Name(id='d', ctx=Store()))],
body=... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43a5505b-4f50-4123-99ae-ff6d1dd43319 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,498 | supabase-export-v2 | 48ab2cf6fd1ef6d5 | ``return 42`` generates a valid AST node for a return statement, but it cannot be compiled alone (it needs to be inside a function node).
In particular, :func:`ast.parse` won't do any scoping checks, which the
compilation step does. | trusted_official_docs | CPython Docs | ``return 42`` generates a valid AST node for a return statement, but it cannot be compiled alone (it needs to be inside a function node).
In particular, :func:`ast.parse` won't do any scoping checks, which the
compilation step does. | ``return 42`` generates a valid AST node for a return statement, but it cannot be compiled alone (it needs to be inside a function node).
In particular, :func:`ast.parse` won't do any scoping checks, which the
compilation step does. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
45c98868-0a8b-46d2-8c86-e416146f2e1a | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,331 | supabase-export-v2 | 0ecd5bc152dd7491 | else: ... continue ... ... """), indent=4)) Module( body=[ For( target=Name(id='a', ctx=Store()), iter=Name(id='b'), body=[ If( test=Compare( left=Name(id='a'), ops=[ Gt()], comparators=[ Constant(value=5)]), body=[ Break()], orelse=[ Continue()])])])
.. class:: Try(body, handlers, orelse, finalbody) | trusted_official_docs | CPython Docs | else: ... continue ... ... """), indent=4)) Module( body=[ For( target=Name(id='a', ctx=Store()), iter=Name(id='b'), body=[ If( test=Compare( left=Name(id='a'), ops=[ Gt()], comparators=[ Constant(value=5)]), body=[ Break()], orelse=[ Continue()])])])
.. class:: Try(body, handlers, orelse, finalbody) | else: ... continue ... ... """), indent=4)) Module( body=[ For( target=Name(id='a', ctx=Store()), iter=Name(id='b'), body=[ If( test=Compare( left=Name(id='a'), ops=[ Gt()], comparators=[ Constant(value=5)]), body=[ Break()], orelse=[ Continue()])])])
.. class:: Try(body, handlers, orelse, finalbody) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46359cd8-7a00-4774-b1e6-474aa0b13e2a | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,506 | supabase-export-v2 | 857f7c60e100dcd8 | produced code string will not necessarily be equal to the original code that generated the :class:`ast.AST` object (without any compiler optimizations, such as constant tuples/frozensets).
.. warning::
Trying to unparse a highly complex expression would result with
:exc:`RecursionError`. | trusted_official_docs | CPython Docs | produced code string will not necessarily be equal to the original code that generated the :class:`ast.AST` object (without any compiler optimizations, such as constant tuples/frozensets).
.. warning::
Trying to unparse a highly complex expression would result with
:exc:`RecursionError`. | produced code string will not necessarily be equal to the original code that generated the :class:`ast.AST` object (without any compiler optimizations, such as constant tuples/frozensets).
.. warning::
Trying to unparse a highly complex expression would result with
:exc:`RecursionError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46f16231-9c0b-4cae-bdbf-48e1b6ce2a26 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,125 | supabase-export-v2 | 8a515bedd424c73c | .. class:: FunctionType(argtypes, returns)
A representation of an old-style type comments for functions,
as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``"func_type"``. | trusted_official_docs | CPython Docs | .. class:: FunctionType(argtypes, returns)
A representation of an old-style type comments for functions,
as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``"func_type"``. | .. class:: FunctionType(argtypes, returns)
A representation of an old-style type comments for functions,
as Python versions prior to 3.5 didn't support :pep:`484` annotations. Node type generated by :func:`ast.parse` when *mode* is ``"func_type"``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
48063e8d-2c9a-4207-9e6d-38aa3a34ff9f | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,243 | supabase-export-v2 | e2f6c23501994ba0 | .. class:: ListComp(elt, generators) SetComp(elt, generators) GeneratorExp(elt, generators) DictComp(key, value, generators)
List and set comprehensions, generator expressions, and dictionary
comprehensions. ``elt`` (or ``key`` and ``value``) is a single node
representing the part that will be evaluated for each item... | trusted_official_docs | CPython Docs | .. class:: ListComp(elt, generators) SetComp(elt, generators) GeneratorExp(elt, generators) DictComp(key, value, generators)
List and set comprehensions, generator expressions, and dictionary
comprehensions. ``elt`` (or ``key`` and ``value``) is a single node
representing the part that will be evaluated for each item... | .. class:: ListComp(elt, generators) SetComp(elt, generators) GeneratorExp(elt, generators) DictComp(key, value, generators)
List and set comprehensions, generator expressions, and dictionary
comprehensions. ``elt`` (or ``key`` and ``value``) is a single node
representing the part that will be evaluated for each item... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
48076f1d-3b28-4ca0-af18-3bfce7e7f4a3 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,155 | supabase-export-v2 | 55bdb2d7a22ee094 | Node representing a single interpolation field in a template string literal.
* ``value`` is any expression node (such as a literal, a variable, or a
function call). This has the same meaning as ``FormattedValue.value``. * ``str`` is a constant containing the text of the interpolation expression. | trusted_official_docs | CPython Docs | Node representing a single interpolation field in a template string literal.
* ``value`` is any expression node (such as a literal, a variable, or a
function call). This has the same meaning as ``FormattedValue.value``. * ``str`` is a constant containing the text of the interpolation expression. | Node representing a single interpolation field in a template string literal.
* ``value`` is any expression node (such as a literal, a variable, or a
function call). This has the same meaning as ``FormattedValue.value``. * ``str`` is a constant containing the text of the interpolation expression. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
48750e78-27e8-4de6-a996-ba192192e0ec | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,071 | supabase-export-v2 | 1fe29e456ccc00c4 | node classes are derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:`above <abstract-grammar>`. They are defined in the :mod:`!_ast` C module and re-exported in :mod:`!ast`.
There is one class defined for each left-hand side symbol in the abstract
grammar (for example, :class:`ast.stmt` or :cla... | trusted_official_docs | CPython Docs | node classes are derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:`above <abstract-grammar>`. They are defined in the :mod:`!_ast` C module and re-exported in :mod:`!ast`.
There is one class defined for each left-hand side symbol in the abstract
grammar (for example, :class:`ast.stmt` or :cla... | node classes are derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:`above <abstract-grammar>`. They are defined in the :mod:`!_ast` C module and re-exported in :mod:`!ast`.
There is one class defined for each left-hand side symbol in the abstract
grammar (for example, :class:`ast.stmt` or :cla... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4969bb25-ca41-43d9-8494-ca71193686fe | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,416 | supabase-export-v2 | b723b62893c76867 | .. doctest::
>>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), indent=4))
Module(
body=[
Assign(
targets=[
Name(id='x', ctx=Store())],
value=Constant(value=1))],
type_ignores=[
TypeIgnore(lineno=1, tag='')])
>>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', type_com... | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), indent=4))
Module(
body=[
Assign(
targets=[
Name(id='x', ctx=Store())],
value=Constant(value=1))],
type_ignores=[
TypeIgnore(lineno=1, tag='')])
>>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', type_com... | .. doctest::
>>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), indent=4))
Module(
body=[
Assign(
targets=[
Name(id='x', ctx=Store())],
value=Constant(value=1))],
type_ignores=[
TypeIgnore(lineno=1, tag='')])
>>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', type_com... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49bc6819-b660-4fb8-ac5f-7715ae5872cb | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,434 | supabase-export-v2 | a55694c4b1b99cf1 | .. class:: TypeVarTuple(name, default_value)
A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` has no
default, this attribute will be set to ``None``. | trusted_official_docs | CPython Docs | .. class:: TypeVarTuple(name, default_value)
A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` has no
default, this attribute will be set to ``None``. | .. class:: TypeVarTuple(name, default_value)
A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` has no
default, this attribute will be set to ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4bf31aa7-6e3a-4099-92d6-135556362efd | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,248 | supabase-export-v2 | 49857d54b8190ce4 | ctx=Store()), iter=Name(id='numbers'), is_async=0)])) >>> print(ast.dump( ... ast.parse('{x for x in numbers}', mode='eval'), ... indent=4, ... )) Expression( body=SetComp( elt=Name(id='x'), generators=[ comprehension( target=Name(id='x', ctx=Store()), iter=Name(id='numbers'), is_async=0)]))
.. class:: comprehension(ta... | trusted_official_docs | CPython Docs | ctx=Store()), iter=Name(id='numbers'), is_async=0)])) >>> print(ast.dump( ... ast.parse('{x for x in numbers}', mode='eval'), ... indent=4, ... )) Expression( body=SetComp( elt=Name(id='x'), generators=[ comprehension( target=Name(id='x', ctx=Store()), iter=Name(id='numbers'), is_async=0)]))
.. class:: comprehension(ta... | ctx=Store()), iter=Name(id='numbers'), is_async=0)])) >>> print(ast.dump( ... ast.parse('{x for x in numbers}', mode='eval'), ... indent=4, ... )) Expression( body=SetComp( elt=Name(id='x'), generators=[ comprehension( target=Name(id='x', ctx=Store()), iter=Name(id='numbers'), is_async=0)]))
.. class:: comprehension(ta... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4d519275-efb5-4c18-b916-291c265a8cf1 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,366 | supabase-export-v2 | 3d527c367640e739 | .. class:: MatchValue(value)
A match literal or value pattern that compares by equality. ``value`` is
an expression node. Permitted value nodes are restricted as described in
the match statement documentation. This pattern succeeds if the match
subject is equal to the evaluated value. | trusted_official_docs | CPython Docs | .. class:: MatchValue(value)
A match literal or value pattern that compares by equality. ``value`` is
an expression node. Permitted value nodes are restricted as described in
the match statement documentation. This pattern succeeds if the match
subject is equal to the evaluated value. | .. class:: MatchValue(value)
A match literal or value pattern that compares by equality. ``value`` is
an expression node. Permitted value nodes are restricted as described in
the match statement documentation. This pattern succeeds if the match
subject is equal to the evaluated value. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4f3b3451-a38d-4803-a881-c4acd4b90f5e | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,140 | supabase-export-v2 | 2b3704a542d7ed00 | field in an f-string. If the string contains a single formatting field and nothing else the node can be isolated otherwise it appears in :class:`JoinedStr`.
* ``value`` is any expression node (such as a literal, a variable, or a
function call). * ``conversion`` is an integer: | trusted_official_docs | CPython Docs | field in an f-string. If the string contains a single formatting field and nothing else the node can be isolated otherwise it appears in :class:`JoinedStr`.
* ``value`` is any expression node (such as a literal, a variable, or a
function call). * ``conversion`` is an integer: | field in an f-string. If the string contains a single formatting field and nothing else the node can be isolated otherwise it appears in :class:`JoinedStr`.
* ``value`` is any expression node (such as a literal, a variable, or a
function call). * ``conversion`` is an integer: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
50b9a0db-abc0-49af-be07-31626fdb55cf | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,316 | supabase-export-v2 | f3753b8b4dbf22e8 | .. doctest::
>>> print(ast.dump(ast.parse("""
... if x:
... ... ... elif y:
... ... ... else:
... ... ... """), indent=4))
Module(
body=[
If(
test=Name(id='x'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
If(
test=Name(id='y'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(... | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse("""
... if x:
... ... ... elif y:
... ... ... else:
... ... ... """), indent=4))
Module(
body=[
If(
test=Name(id='x'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
If(
test=Name(id='y'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(... | .. doctest::
>>> print(ast.dump(ast.parse("""
... if x:
... ... ... elif y:
... ... ... else:
... ... ... """), indent=4))
Module(
body=[
If(
test=Name(id='x'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
If(
test=Name(id='y'),
body=[
Expr(
value=Constant(value=Ellipsis))],
orelse=[
Expr(... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52b0c486-cbfd-43d1-8caa-30f0a245870b | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,214 | supabase-export-v2 | 979ee06f4c800e01 | A function call. ``func`` is the function, which will often be a :class:`Name` or :class:`Attribute` object. Of the arguments:
* ``args`` holds a list of the arguments passed by position. * ``keywords`` holds a list of :class:`.keyword` objects representing
arguments passed by keyword. | trusted_official_docs | CPython Docs | A function call. ``func`` is the function, which will often be a :class:`Name` or :class:`Attribute` object. Of the arguments:
* ``args`` holds a list of the arguments passed by position. * ``keywords`` holds a list of :class:`.keyword` objects representing
arguments passed by keyword. | A function call. ``func`` is the function, which will often be a :class:`Name` or :class:`Attribute` object. Of the arguments:
* ``args`` holds a list of the arguments passed by position. * ``keywords`` holds a list of :class:`.keyword` objects representing
arguments passed by keyword. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53792f52-10dd-4a40-8607-73515c118a3e | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,555 | supabase-export-v2 | f938ea03d8365134 | def visit_Name(self, node): return Subscript( value=Name(id='data'), slice=Constant(value=node.id), ctx=node.ctx )
Keep in mind that if the node you're operating on has child nodes you must
either transform the child nodes yourself or call the :meth:`~ast.NodeVisitor.generic_visit`
method for the node first. | trusted_official_docs | CPython Docs | def visit_Name(self, node): return Subscript( value=Name(id='data'), slice=Constant(value=node.id), ctx=node.ctx )
Keep in mind that if the node you're operating on has child nodes you must
either transform the child nodes yourself or call the :meth:`~ast.NodeVisitor.generic_visit`
method for the node first. | def visit_Name(self, node): return Subscript( value=Name(id='data'), slice=Constant(value=node.id), ctx=node.ctx )
Keep in mind that if the node you're operating on has child nodes you must
either transform the child nodes yourself or call the :meth:`~ast.NodeVisitor.generic_visit`
method for the node first. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56d86ed5-6830-46fc-b229-f81fa3f611c4 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,398 | supabase-export-v2 | 73cf1d8fcfe022ba | >>> print(ast.dump(ast.parse(""" ... match x: ... case Point2D(0, 0): ... ... ... case Point3D(x=0, y=0, z=0): ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchClass(
cls=Name(id='Point2D'),
patterns=[
MatchValue(
value=Constant(value=0)),
MatchValue(... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse(""" ... match x: ... case Point2D(0, 0): ... ... ... case Point3D(x=0, y=0, z=0): ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchClass(
cls=Name(id='Point2D'),
patterns=[
MatchValue(
value=Constant(value=0)),
MatchValue(... | >>> print(ast.dump(ast.parse(""" ... match x: ... case Point2D(0, 0): ... ... ... case Point3D(x=0, y=0, z=0): ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchClass(
cls=Name(id='Point2D'),
patterns=[
MatchValue(
value=Constant(value=0)),
MatchValue(... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56dfd4f0-eb4f-42d9-80de-14b637428614 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,552 | supabase-export-v2 | 172de0d202de1b79 | its location, otherwise it is replaced with the return value. The return value may be the original node in which case no replacement takes place.
Here is an example transformer that rewrites all occurrences of name lookups
(``foo``) to ``data['foo']``:: | trusted_official_docs | CPython Docs | its location, otherwise it is replaced with the return value. The return value may be the original node in which case no replacement takes place.
Here is an example transformer that rewrites all occurrences of name lookups
(``foo``) to ``data['foo']``:: | its location, otherwise it is replaced with the return value. The return value may be the original node in which case no replacement takes place.
Here is an example transformer that rewrites all occurrences of name lookups
(``foo``) to ``data['foo']``:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
583c79c8-5bea-4ae5-acd2-3a0f147a6beb | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,487 | supabase-export-v2 | 4a700fce49c61cce | .. class:: AsyncFor(target, iter, body, orelse, type_comment) AsyncWith(items, body, type_comment)
``async for`` loops and ``async with`` context managers. They have the same
fields as :class:`For` and :class:`With`, respectively. Only valid in the
body of an :class:`AsyncFunctionDef`. | trusted_official_docs | CPython Docs | .. class:: AsyncFor(target, iter, body, orelse, type_comment) AsyncWith(items, body, type_comment)
``async for`` loops and ``async with`` context managers. They have the same
fields as :class:`For` and :class:`With`, respectively. Only valid in the
body of an :class:`AsyncFunctionDef`. | .. class:: AsyncFor(target, iter, body, orelse, type_comment) AsyncWith(items, body, type_comment)
``async for`` loops and ``async with`` context managers. They have the same
fields as :class:`For` and :class:`With`, respectively. Only valid in the
body of an :class:`AsyncFunctionDef`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5b790b90-777b-4593-b736-b57bca3acea4 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,499 | supabase-export-v2 | 060253842fca1edf | In particular, :func:`ast.parse` won't do any scoping checks, which the compilation step does.
.. warning::
It is possible to crash the Python interpreter with a
sufficiently large/complex string due to stack depth limitations
in Python's AST compiler. | trusted_official_docs | CPython Docs | In particular, :func:`ast.parse` won't do any scoping checks, which the compilation step does.
.. warning::
It is possible to crash the Python interpreter with a
sufficiently large/complex string due to stack depth limitations
in Python's AST compiler. | In particular, :func:`ast.parse` won't do any scoping checks, which the compilation step does.
.. warning::
It is possible to crash the Python interpreter with a
sufficiently large/complex string due to stack depth limitations
in Python's AST compiler. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5c250670-00fe-4ee4-94f4-e6a1159aef3d | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,476 | supabase-export-v2 | e12817ebf7cf6db2 | .. doctest::
>>> print(ast.dump(ast.parse("""\
... @decorator1
... @decorator2
... class Foo(base1, base2, metaclass=meta):
... pass
... """), indent=4))
Module(
body=[
ClassDef(
name='Foo',
bases=[
Name(id='base1'),
Name(id='base2')],
keywords=[
keyword(
arg='metaclass',
value=Name(id='meta'))],
body=... | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse("""\
... @decorator1
... @decorator2
... class Foo(base1, base2, metaclass=meta):
... pass
... """), indent=4))
Module(
body=[
ClassDef(
name='Foo',
bases=[
Name(id='base1'),
Name(id='base2')],
keywords=[
keyword(
arg='metaclass',
value=Name(id='meta'))],
body=... | .. doctest::
>>> print(ast.dump(ast.parse("""\
... @decorator1
... @decorator2
... class Foo(base1, base2, metaclass=meta):
... pass
... """), indent=4))
Module(
body=[
ClassDef(
name='Foo',
bases=[
Name(id='base1'),
Name(id='base2')],
keywords=[
keyword(
arg='metaclass',
value=Name(id='meta'))],
body=... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d2d565e-8a7c-4fb6-9bf8-9a2c146ef656 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,274 | supabase-export-v2 | 7e8dc636814df0f2 | .. class:: AugAssign(target, op, value)
Augmented assignment, such as ``a += 1``. In the following example,
``target`` is a :class:`Name` node for ``x`` (with the :class:`Store`
context), ``op`` is :class:`Add`, and ``value`` is a :class:`Constant` with
value for 1. | trusted_official_docs | CPython Docs | .. class:: AugAssign(target, op, value)
Augmented assignment, such as ``a += 1``. In the following example,
``target`` is a :class:`Name` node for ``x`` (with the :class:`Store`
context), ``op`` is :class:`Add`, and ``value`` is a :class:`Constant` with
value for 1. | .. class:: AugAssign(target, op, value)
Augmented assignment, such as ``a += 1``. In the following example,
``target`` is a :class:`Name` node for ``x`` (with the :class:`Store`
context), ``op`` is :class:`Add`, and ``value`` is a :class:`Constant` with
value for 1. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5da87374-8d24-4d53-8a99-735795572bf6 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,219 | supabase-export-v2 | 1cac5e79764e1316 | .. class:: keyword(arg, value)
A keyword argument to a function call or class definition. ``arg`` is a raw
string of the parameter name, ``value`` is a node to pass in. | trusted_official_docs | CPython Docs | .. class:: keyword(arg, value)
A keyword argument to a function call or class definition. ``arg`` is a raw
string of the parameter name, ``value`` is a node to pass in. | .. class:: keyword(arg, value)
A keyword argument to a function call or class definition. ``arg`` is a raw
string of the parameter name, ``value`` is a node to pass in. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5f49b8b7-e29c-4317-b8c2-07c275e662f3 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,293 | supabase-export-v2 | 57d235c0c4d586e6 | .. class:: TypeAlias(name, type_params, value)
A :ref:`type alias <type-aliases>` created through the :keyword:`type`
statement. ``name`` is the name of the alias, ``type_params`` is a list of
:ref:`type parameters <ast-type-params>`, and ``value`` is the value of the
type alias. | trusted_official_docs | CPython Docs | .. class:: TypeAlias(name, type_params, value)
A :ref:`type alias <type-aliases>` created through the :keyword:`type`
statement. ``name`` is the name of the alias, ``type_params`` is a list of
:ref:`type parameters <ast-type-params>`, and ``value`` is the value of the
type alias. | .. class:: TypeAlias(name, type_params, value)
A :ref:`type alias <type-aliases>` created through the :keyword:`type`
statement. ``name`` is the name of the alias, ``type_params`` is a list of
:ref:`type parameters <ast-type-params>`, and ``value`` is the value of the
type alias. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6015b01a-6e3c-4279-b00b-600e3f13f8fe | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,496 | supabase-export-v2 | 060874e3a3938b11 | there is no guarantee that the parse (or success of the parse) is the same as when run on the Python version corresponding to ``feature_version``.
If source contains a null character (``\0``), :exc:`ValueError` is raised. | trusted_official_docs | CPython Docs | there is no guarantee that the parse (or success of the parse) is the same as when run on the Python version corresponding to ``feature_version``.
If source contains a null character (``\0``), :exc:`ValueError` is raised. | there is no guarantee that the parse (or success of the parse) is the same as when run on the Python version corresponding to ``feature_version``.
If source contains a null character (``\0``), :exc:`ValueError` is raised. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
61640b38-a074-4c35-b49c-3f8cfbc71bdf | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,318 | supabase-export-v2 | c91cf98b85f41b41 | .. class:: For(target, iter, body, orelse, type_comment)
A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a
single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or
:class:`Subscript` node. ``iter`` holds the item to be looped over, again
as a single node. ``body`` and ``ore... | trusted_official_docs | CPython Docs | .. class:: For(target, iter, body, orelse, type_comment)
A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a
single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or
:class:`Subscript` node. ``iter`` holds the item to be looped over, again
as a single node. ``body`` and ``ore... | .. class:: For(target, iter, body, orelse, type_comment)
A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a
single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or
:class:`Subscript` node. ``iter`` holds the item to be looped over, again
as a single node. ``body`` and ``ore... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6235f1ea-72b7-4ca2-9de8-3052a743c8d0 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,386 | supabase-export-v2 | 2dc42d83dd71d9e6 | .. class:: MatchMapping(keys, patterns, rest)
A match mapping pattern. ``keys`` is a sequence of expression nodes. ``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an
optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as describ... | trusted_official_docs | CPython Docs | .. class:: MatchMapping(keys, patterns, rest)
A match mapping pattern. ``keys`` is a sequence of expression nodes. ``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an
optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as describ... | .. class:: MatchMapping(keys, patterns, rest)
A match mapping pattern. ``keys`` is a sequence of expression nodes. ``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an
optional name that can be specified to capture the remaining mapping elements. Permitted key expressions are restricted as describ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
63698862-5033-49d9-94f1-46a7dd9e0319 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,084 | supabase-export-v2 | f6eed3b3b4342f92 | corresponding UTF-8 byte offsets of the first and last tokens that generated the node. The UTF-8 offset is recorded because the parser uses UTF-8 internally.
Note that the end positions are not required by the compiler and are
therefore optional. The end offset is *after* the last symbol, for example
one can get the ... | trusted_official_docs | CPython Docs | corresponding UTF-8 byte offsets of the first and last tokens that generated the node. The UTF-8 offset is recorded because the parser uses UTF-8 internally.
Note that the end positions are not required by the compiler and are
therefore optional. The end offset is *after* the last symbol, for example
one can get the ... | corresponding UTF-8 byte offsets of the first and last tokens that generated the node. The UTF-8 offset is recorded because the parser uses UTF-8 internally.
Note that the end positions are not required by the compiler and are
therefore optional. The end offset is *after* the last symbol, for example
one can get the ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
650c3ba3-55dc-4d8f-a46c-a209e0654df2 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,422 | supabase-export-v2 | c16b0c827d3cd58a | .. class:: TypeVar(name, bound, default_value)
A :class:`typing.TypeVar`. ``name`` is the name of the type variable. ``bound`` is the bound or constraints, if any. If ``bound`` is a :class:`Tuple`,
it represents constraints; otherwise it represents the bound. ``default_value``
is the default value; if the :class:`!Ty... | trusted_official_docs | CPython Docs | .. class:: TypeVar(name, bound, default_value)
A :class:`typing.TypeVar`. ``name`` is the name of the type variable. ``bound`` is the bound or constraints, if any. If ``bound`` is a :class:`Tuple`,
it represents constraints; otherwise it represents the bound. ``default_value``
is the default value; if the :class:`!Ty... | .. class:: TypeVar(name, bound, default_value)
A :class:`typing.TypeVar`. ``name`` is the name of the type variable. ``bound`` is the bound or constraints, if any. If ``bound`` is a :class:`Tuple`,
it represents constraints; otherwise it represents the bound. ``default_value``
is the default value; if the :class:`!Ty... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
662d51c6-a832-4670-a2cf-99566c3ee17d | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,428 | supabase-export-v2 | 38b8099706bb43a4 | .. class:: ParamSpec(name, default_value)
A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification. ``default_value`` is the default value; if the :class:`!ParamSpec` has no default,
this attribute will be set to ``None``. | trusted_official_docs | CPython Docs | .. class:: ParamSpec(name, default_value)
A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification. ``default_value`` is the default value; if the :class:`!ParamSpec` has no default,
this attribute will be set to ``None``. | .. class:: ParamSpec(name, default_value)
A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification. ``default_value`` is the default value; if the :class:`!ParamSpec` has no default,
this attribute will be set to ``None``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
66bc4a31-377f-4cbf-9430-7c0d70ae198f | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,500 | supabase-export-v2 | 7c0cbce1e5bae741 | .. warning:: It is possible to crash the Python interpreter with a sufficiently large/complex string due to stack depth limitations in Python's AST compiler.
.. versionchanged:: 3.8
Added ``type_comments``, ``mode='func_type'`` and ``feature_version``. | trusted_official_docs | CPython Docs | .. warning:: It is possible to crash the Python interpreter with a sufficiently large/complex string due to stack depth limitations in Python's AST compiler.
.. versionchanged:: 3.8
Added ``type_comments``, ``mode='func_type'`` and ``feature_version``. | .. warning:: It is possible to crash the Python interpreter with a sufficiently large/complex string due to stack depth limitations in Python's AST compiler.
.. versionchanged:: 3.8
Added ``type_comments``, ``mode='func_type'`` and ``feature_version``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
67b9a4a3-20e0-4a3d-99ac-701d0d1a86d8 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,405 | supabase-export-v2 | ed1151556fd0f4a9 | >>> print(ast.dump(ast.parse(""" ... match x: ... case [x] as y: ... ... ... case _: ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchAs(
pattern=MatchSequence(
patterns=[
MatchAs(name='x')]),
name='y'),
body=[
Expr(
value=Constant(value=Ellipsis))]... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse(""" ... match x: ... case [x] as y: ... ... ... case _: ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchAs(
pattern=MatchSequence(
patterns=[
MatchAs(name='x')]),
name='y'),
body=[
Expr(
value=Constant(value=Ellipsis))]... | >>> print(ast.dump(ast.parse(""" ... match x: ... case [x] as y: ... ... ... case _: ... ... ...
"""), indent=4))
Module(
body=[
Match(
subject=Name(id='x'),
cases=[
match_case(
pattern=MatchAs(
pattern=MatchSequence(
patterns=[
MatchAs(name='x')]),
name='y'),
body=[
Expr(
value=Constant(value=Ellipsis))]... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
68a24bef-b621-4631-bd61-9fed55f5d151 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,201 | supabase-export-v2 | 64d18b80d366dde8 | .. class:: BoolOp(op, values)
A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. ``values`` are the values involved. Consecutive operations with the same
operator, such as ``a or b or c``, are collapsed into one node with several
values. | trusted_official_docs | CPython Docs | .. class:: BoolOp(op, values)
A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. ``values`` are the values involved. Consecutive operations with the same
operator, such as ``a or b or c``, are collapsed into one node with several
values. | .. class:: BoolOp(op, values)
A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. ``values`` are the values involved. Consecutive operations with the same
operator, such as ``a or b or c``, are collapsed into one node with several
values. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6a51ce0a-7b9e-4c89-9242-a354a2a9d23e | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,537 | supabase-export-v2 | efaeefdd9b8b722f | .. class:: NodeVisitor()
A node visitor base class that walks the abstract syntax tree and calls a
visitor function for every node found. This function may return a value
which is forwarded by the :meth:`visit` method. | trusted_official_docs | CPython Docs | .. class:: NodeVisitor()
A node visitor base class that walks the abstract syntax tree and calls a
visitor function for every node found. This function may return a value
which is forwarded by the :meth:`visit` method. | .. class:: NodeVisitor()
A node visitor base class that walks the abstract syntax tree and calls a
visitor function for every node found. This function may return a value
which is forwarded by the :meth:`visit` method. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b96fbed-9ad8-455b-8f53-159a811dcdc6 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,252 | supabase-export-v2 | 0da106be0488f0f9 | .. doctest::
>>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', mode='eval'),
... indent=4)) # Multiple comprehensions in one. Expression(
body=ListComp(
elt=Call(
func=Name(id='ord'),
args=[
Name(id='c')]),
generators=[
comprehension(
target=Name(id='line', ctx=Store()),
iter=Name(id='fi... | trusted_official_docs | CPython Docs | .. doctest::
>>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', mode='eval'),
... indent=4)) # Multiple comprehensions in one. Expression(
body=ListComp(
elt=Call(
func=Name(id='ord'),
args=[
Name(id='c')]),
generators=[
comprehension(
target=Name(id='line', ctx=Store()),
iter=Name(id='fi... | .. doctest::
>>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', mode='eval'),
... indent=4)) # Multiple comprehensions in one. Expression(
body=ListComp(
elt=Call(
func=Name(id='ord'),
args=[
Name(id='c')]),
generators=[
comprehension(
target=Name(id='line', ctx=Store()),
iter=Name(id='fi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6bb1cdcc-527f-48b9-af89-bc563e25b20c | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,395 | supabase-export-v2 | 09d4283e2c2ffef9 | subject is an instance of the nominated class, all positional patterns match the corresponding class-defined attributes, and any specified keyword attributes match their corresponding pattern.
Note: classes may define a property that returns self in order to match a
pattern node against the instance being matched. Sev... | trusted_official_docs | CPython Docs | subject is an instance of the nominated class, all positional patterns match the corresponding class-defined attributes, and any specified keyword attributes match their corresponding pattern.
Note: classes may define a property that returns self in order to match a
pattern node against the instance being matched. Sev... | subject is an instance of the nominated class, all positional patterns match the corresponding class-defined attributes, and any specified keyword attributes match their corresponding pattern.
Note: classes may define a property that returns self in order to match a
pattern node against the instance being matched. Sev... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6cabe857-926a-4748-af01-b1b70d0f0375 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,360 | supabase-export-v2 | e4815bc01ffe53c9 | The ``guard`` attribute contains an expression that will be evaluated if the pattern matches the subject.
``body`` contains a list of nodes to execute if the pattern matches and
the result of evaluating the guard expression is true. | trusted_official_docs | CPython Docs | The ``guard`` attribute contains an expression that will be evaluated if the pattern matches the subject.
``body`` contains a list of nodes to execute if the pattern matches and
the result of evaluating the guard expression is true. | The ``guard`` attribute contains an expression that will be evaluated if the pattern matches the subject.
``body`` contains a list of nodes to execute if the pattern matches and
the result of evaluating the guard expression is true. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6cfab386-cb96-44fb-83b0-6eef25afbc45 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,264 | supabase-export-v2 | 96bf43bf43aeb33e | >>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment Module( body=[ Assign( targets=[ Name(id='a', ctx=Store()), Name(id='b', ctx=Store())], value=Constant(value=1))])
>>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking
Module(
body=[
Assign(
targets=[
Tuple(
elts=[
Name(id='a'... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment Module( body=[ Assign( targets=[ Name(id='a', ctx=Store()), Name(id='b', ctx=Store())], value=Constant(value=1))])
>>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking
Module(
body=[
Assign(
targets=[
Tuple(
elts=[
Name(id='a'... | >>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment Module( body=[ Assign( targets=[ Name(id='a', ctx=Store()), Name(id='b', ctx=Store())], value=Constant(value=1))])
>>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking
Module(
body=[
Assign(
targets=[
Tuple(
elts=[
Name(id='a'... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6d2188cf-dc04-4113-b51d-cfb57dc5a31f | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,358 | supabase-export-v2 | 83897d8d856524c9 | .. class:: match_case(pattern, guard, body)
A single case pattern in a ``match`` statement. ``pattern`` contains the
match pattern that the subject will be matched against. Note that the
:class:`AST` nodes produced for patterns differ from those produced for
expressions, even when they share the same syntax. | trusted_official_docs | CPython Docs | .. class:: match_case(pattern, guard, body)
A single case pattern in a ``match`` statement. ``pattern`` contains the
match pattern that the subject will be matched against. Note that the
:class:`AST` nodes produced for patterns differ from those produced for
expressions, even when they share the same syntax. | .. class:: match_case(pattern, guard, body)
A single case pattern in a ``match`` statement. ``pattern`` contains the
match pattern that the subject will be matched against. Note that the
:class:`AST` nodes produced for patterns differ from those produced for
expressions, even when they share the same syntax. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6ec8690b-d858-4e5b-8354-40d636f65009 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,551 | supabase-export-v2 | 6d30e1bd914fe096 | A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes.
The :class:`NodeTransformer` will walk the AST and use the return value of
the visitor methods to replace or remove the old node. If the return value
of the visitor method is ``None``, the node will be removed from i... | trusted_official_docs | CPython Docs | A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes.
The :class:`NodeTransformer` will walk the AST and use the return value of
the visitor methods to replace or remove the old node. If the return value
of the visitor method is ``None``, the node will be removed from i... | A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes.
The :class:`NodeTransformer` will walk the AST and use the return value of
the visitor methods to replace or remove the old node. If the return value
of the visitor method is ``None``, the node will be removed from i... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6fafaa17-3756-43fa-9a30-be2676b986fc | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,563 | supabase-export-v2 | 53421c7bf2ce254f | field names. Attributes such as line numbers and column offsets are not dumped by default. If this is wanted, *include_attributes* can be set to true.
If *color* is ``True``, the returned string is syntax highlighted using
ANSI escape sequences. If ``False`` (the default), colored output is always disabled. | trusted_official_docs | CPython Docs | field names. Attributes such as line numbers and column offsets are not dumped by default. If this is wanted, *include_attributes* can be set to true.
If *color* is ``True``, the returned string is syntax highlighted using
ANSI escape sequences. If ``False`` (the default), colored output is always disabled. | field names. Attributes such as line numbers and column offsets are not dumped by default. If this is wanted, *include_attributes* can be set to true.
If *color* is ``True``, the returned string is syntax highlighted using
ANSI escape sequences. If ``False`` (the default), colored output is always disabled. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6fde2723-6c12-4c47-b164-93dc7595c8a9 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,486 | supabase-export-v2 | adf2c7c4e6a1d4cb | >>> print(ast.dump(ast.parse("""\ ... async def f(): ... await other_func() ... """), indent=4)) Module( body=[ AsyncFunctionDef( name='f', args=arguments(), body=[ Expr( value=Await( value=Call( func=Name(id='other_func'))))])])
.. class:: AsyncFor(target, iter, body, orelse, type_comment)
AsyncWith(items, body, type... | trusted_official_docs | CPython Docs | >>> print(ast.dump(ast.parse("""\ ... async def f(): ... await other_func() ... """), indent=4)) Module( body=[ AsyncFunctionDef( name='f', args=arguments(), body=[ Expr( value=Await( value=Call( func=Name(id='other_func'))))])])
.. class:: AsyncFor(target, iter, body, orelse, type_comment)
AsyncWith(items, body, type... | >>> print(ast.dump(ast.parse("""\ ... async def f(): ... await other_func() ... """), indent=4)) Module( body=[ AsyncFunctionDef( name='f', args=arguments(), body=[ Expr( value=Await( value=Call( func=Name(id='other_func'))))])])
.. class:: AsyncFor(target, iter, body, orelse, type_comment)
AsyncWith(items, body, type... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
71585374-d792-4faa-823f-8c8fe4d6fe53 | CPython Docs | file://datasets/cpython/Doc/library/ast.rst | unknown | d088e5d2-01b6-4edf-8f87-f277552a22d9 | 29,157 | supabase-export-v2 | 1aab873290f2181f | :func:`ast.unparse`. This no longer guarantees that the generated code is identical to the original and is intended for code generation. * ``conversion`` is an integer:
* -1: no conversion
* 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion
* 114 (``ord('r')``): ``!r`` :func:`repr` conversion
* 115 (``ord('... | trusted_official_docs | CPython Docs | :func:`ast.unparse`. This no longer guarantees that the generated code is identical to the original and is intended for code generation. * ``conversion`` is an integer:
* -1: no conversion
* 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion
* 114 (``ord('r')``): ``!r`` :func:`repr` conversion
* 115 (``ord('... | :func:`ast.unparse`. This no longer guarantees that the generated code is identical to the original and is intended for code generation. * ``conversion`` is an integer:
* -1: no conversion
* 97 (``ord('a')``): ``!a`` :func:`ASCII <ascii>` conversion
* 114 (``ord('r')``): ``!r`` :func:`repr` conversion
* 115 (``ord('... | 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.