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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba219700-69cb-450e-a1a1-9165d2de2778 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,022 | supabase-export-v2 | 63f78fbc9433ddd8 | .. method:: read([n])
Return a :class:`bytes` containing up to *n* bytes starting from the
current file position. If the argument is omitted, ``None`` or negative,
return all bytes from the current file position to the end of the
mapping. The file position is updated to point after the bytes that were
returned. | trusted_official_docs | CPython Docs | .. method:: read([n])
Return a :class:`bytes` containing up to *n* bytes starting from the
current file position. If the argument is omitted, ``None`` or negative,
return all bytes from the current file position to the end of the
mapping. The file position is updated to point after the bytes that were
returned. | .. method:: read([n])
Return a :class:`bytes` containing up to *n* bytes starting from the
current file position. If the argument is omitted, ``None`` or negative,
return all bytes from the current file position to the end of the
mapping. The file position is updated to point after the bytes that were
returned. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bb3e3568-5e51-4ae4-8c0a-408e807779b1 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,014 | supabase-export-v2 | 292a9b5dc1f579b9 | *size* parameters were required together. Now *offset* can be specified alone, and the flush operation will extend from *offset* to the end of the mmap.
.. versionchanged:: 3.15
Added *flags* parameter to control synchronization behavior. | trusted_official_docs | CPython Docs | *size* parameters were required together. Now *offset* can be specified alone, and the flush operation will extend from *offset* to the end of the mmap.
.. versionchanged:: 3.15
Added *flags* parameter to control synchronization behavior. | *size* parameters were required together. Now *offset* can be specified alone, and the flush operation will extend from *offset* to the end of the mmap.
.. versionchanged:: 3.15
Added *flags* parameter to control synchronization behavior. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bc30d888-9d87-4894-9fc2-90715806b7e8 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,032 | supabase-export-v2 | 3c9f26f4e5dc3238 | map (ie against the pagefile) will silently create a new map with the original data copied over up to the length of the new size.
Availability: Windows and systems with the ``mremap()`` system call. | trusted_official_docs | CPython Docs | map (ie against the pagefile) will silently create a new map with the original data copied over up to the length of the new size.
Availability: Windows and systems with the ``mremap()`` system call. | map (ie against the pagefile) will silently create a new map with the original data copied over up to the length of the new size.
Availability: Windows and systems with the ``mremap()`` system call. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bca62546-72e3-425b-8015-1698dcc511b4 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,038 | supabase-export-v2 | cffd8fcb7d6cd7c6 | .. method:: seek(pos[, whence])
Set the file's current position. *whence* argument is optional and
defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). | trusted_official_docs | CPython Docs | .. method:: seek(pos[, whence])
Set the file's current position. *whence* argument is optional and
defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). | .. method:: seek(pos[, whence])
Set the file's current position. *whence* argument is optional and
defaults to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other
values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf35fd35-9a63-4e12-be7d-6e1f9436ac36 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 39,976 | supabase-export-v2 | 4191ba68ad42b664 | a mmap object. If *length* is ``0``, the maximum length of the map will be the current size of the file when :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
object will be private to this p... | trusted_official_docs | CPython Docs | a mmap object. If *length* is ``0``, the maximum length of the map will be the current size of the file when :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
object will be private to this p... | a mmap object. If *length* is ``0``, the maximum length of the map will be the current size of the file when :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
object will be private to this p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c369b883-e60d-4093-ab29-70304caf0434 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 39,977 | supabase-export-v2 | 5f694e55da02c98d | same areas of the file. The default value is :const:`MAP_SHARED`. Some systems have additional possible flags with the full list specified in :ref:`MAP_* constants <map-constants>`.
*prot*, if specified, gives the desired memory protection; the two most
useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to ... | trusted_official_docs | CPython Docs | same areas of the file. The default value is :const:`MAP_SHARED`. Some systems have additional possible flags with the full list specified in :ref:`MAP_* constants <map-constants>`.
*prot*, if specified, gives the desired memory protection; the two most
useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to ... | same areas of the file. The default value is :const:`MAP_SHARED`. Some systems have additional possible flags with the full list specified in :ref:`MAP_* constants <map-constants>`.
*prot*, if specified, gives the desired memory protection; the two most
useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce6e73bd-9d42-4491-bf19-d6bd43c11e30 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,065 | supabase-export-v2 | c7637959c59e93f6 | .. data:: MAP_SHARED MAP_PRIVATE MAP_32BIT MAP_ALIGNED_SUPER MAP_ANON MAP_ANONYMOUS MAP_CONCEAL MAP_DENYWRITE MAP_EXECUTABLE MAP_HASSEMAPHORE MAP_JIT MAP_NOCACHE MAP_NOEXTEND MAP_NORESERVE MAP_POPULATE MAP_RESILIENT_CODESIGN MAP_RESILIENT_MEDIA MAP_STACK MAP_TPRO MAP_TRANSLATED_ALLOW_EXECUTE MAP_UNIX03
These are the va... | trusted_official_docs | CPython Docs | .. data:: MAP_SHARED MAP_PRIVATE MAP_32BIT MAP_ALIGNED_SUPER MAP_ANON MAP_ANONYMOUS MAP_CONCEAL MAP_DENYWRITE MAP_EXECUTABLE MAP_HASSEMAPHORE MAP_JIT MAP_NOCACHE MAP_NOEXTEND MAP_NORESERVE MAP_POPULATE MAP_RESILIENT_CODESIGN MAP_RESILIENT_MEDIA MAP_STACK MAP_TPRO MAP_TRANSLATED_ALLOW_EXECUTE MAP_UNIX03
These are the va... | .. data:: MAP_SHARED MAP_PRIVATE MAP_32BIT MAP_ALIGNED_SUPER MAP_ANON MAP_ANONYMOUS MAP_CONCEAL MAP_DENYWRITE MAP_EXECUTABLE MAP_HASSEMAPHORE MAP_JIT MAP_NOCACHE MAP_NOEXTEND MAP_NORESERVE MAP_POPULATE MAP_RESILIENT_CODESIGN MAP_RESILIENT_MEDIA MAP_STACK MAP_TPRO MAP_TRANSLATED_ALLOW_EXECUTE MAP_UNIX03
These are the va... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d279ae3b-340e-437d-bb8c-05e42fe57944 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,053 | supabase-export-v2 | 4080bc052e1d0bb2 | updated to point after the bytes that were written. If the mmap was created with :const:`ACCESS_READ`, then writing to it will raise a :exc:`TypeError` exception.
.. versionchanged:: 3.5
Writable :term:`bytes-like object` is now accepted. | trusted_official_docs | CPython Docs | updated to point after the bytes that were written. If the mmap was created with :const:`ACCESS_READ`, then writing to it will raise a :exc:`TypeError` exception.
.. versionchanged:: 3.5
Writable :term:`bytes-like object` is now accepted. | updated to point after the bytes that were written. If the mmap was created with :const:`ACCESS_READ`, then writing to it will raise a :exc:`TypeError` exception.
.. versionchanged:: 3.5
Writable :term:`bytes-like object` is now accepted. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
edc26057-be5d-47b3-8199-de44b6a5fc02 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 39,978 | supabase-export-v2 | 8831a55475771ac7 | the two most useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to specify that the pages may be read or written. *prot* defaults to :const:`PROT_READ \| PROT_WRITE`.
*access* may be specified in lieu of *flags* and *prot* as an optional
keyword parameter. It is an error to specify both *flags*, *prot* and
... | trusted_official_docs | CPython Docs | the two most useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to specify that the pages may be read or written. *prot* defaults to :const:`PROT_READ \| PROT_WRITE`.
*access* may be specified in lieu of *flags* and *prot* as an optional
keyword parameter. It is an error to specify both *flags*, *prot* and
... | the two most useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to specify that the pages may be read or written. *prot* defaults to :const:`PROT_READ \| PROT_WRITE`.
*access* may be specified in lieu of *flags* and *prot* as an optional
keyword parameter. It is an error to specify both *flags*, *prot* and
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f0606826-73b7-48bf-b869-b46446a9c03d | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,030 | supabase-export-v2 | 255032c5be08e511 | Resizes the map and the underlying file, if any.
Resizing a map created with *access* of :const:`ACCESS_READ` or
:const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map created with *trackfd* set to ``False``,
will raise a :exc:`ValueError` exception. | trusted_official_docs | CPython Docs | Resizes the map and the underlying file, if any.
Resizing a map created with *access* of :const:`ACCESS_READ` or
:const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map created with *trackfd* set to ``False``,
will raise a :exc:`ValueError` exception. | Resizes the map and the underlying file, if any.
Resizing a map created with *access* of :const:`ACCESS_READ` or
:const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map created with *trackfd* set to ``False``,
will raise a :exc:`ValueError` exception. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f282a35e-8adb-4c24-b4b2-779453d1dd6d | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,033 | supabase-export-v2 | c5f51b9a02d7efaf | Availability: Windows and systems with the ``mremap()`` system call.
.. versionchanged:: 3.11
Correctly fails if attempting to resize when another map is held
Allows resize against an anonymous map on Windows | trusted_official_docs | CPython Docs | Availability: Windows and systems with the ``mremap()`` system call.
.. versionchanged:: 3.11
Correctly fails if attempting to resize when another map is held
Allows resize against an anonymous map on Windows | Availability: Windows and systems with the ``mremap()`` system call.
.. versionchanged:: 3.11
Correctly fails if attempting to resize when another map is held
Allows resize against an anonymous map on Windows | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3bda3a7-8cd0-4fe2-9747-8caa9cafbcf8 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 39,986 | supabase-export-v2 | 477dfcc13e0b69b4 | # write a simple example file with open("hello.txt", "wb") as f: f.write(b"Hello Python!\n")
with open("hello.txt", "r+b") as f:
# memory-map the file, size 0 means whole file
mm = mmap.mmap(f.fileno(), 0)
# read content via standard file methods
print(mm.readline()) # prints b"Hello Python!\n"
# read content via ... | trusted_official_docs | CPython Docs | # write a simple example file with open("hello.txt", "wb") as f: f.write(b"Hello Python!\n")
with open("hello.txt", "r+b") as f:
# memory-map the file, size 0 means whole file
mm = mmap.mmap(f.fileno(), 0)
# read content via standard file methods
print(mm.readline()) # prints b"Hello Python!\n"
# read content via ... | # write a simple example file with open("hello.txt", "wb") as f: f.write(b"Hello Python!\n")
with open("hello.txt", "r+b") as f:
# memory-map the file, size 0 means whole file
mm = mmap.mmap(f.fileno(), 0)
# read content via standard file methods
print(mm.readline()) # prints b"Hello Python!\n"
# read content via ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fba35a8d-b12e-4e8a-afc9-ed9ca1536565 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,066 | supabase-export-v2 | 94035c852aa1471d | :meth:`mmap.mmap`. :data:`MAP_ALIGNED_SUPER` is only available at FreeBSD and :data:`MAP_CONCEAL` is only available at OpenBSD. Note that some options might not be present on some systems.
.. versionchanged:: 3.10
Added :data:`MAP_POPULATE` constant. | trusted_official_docs | CPython Docs | :meth:`mmap.mmap`. :data:`MAP_ALIGNED_SUPER` is only available at FreeBSD and :data:`MAP_CONCEAL` is only available at OpenBSD. Note that some options might not be present on some systems.
.. versionchanged:: 3.10
Added :data:`MAP_POPULATE` constant. | :meth:`mmap.mmap`. :data:`MAP_ALIGNED_SUPER` is only available at FreeBSD and :data:`MAP_CONCEAL` is only available at OpenBSD. Note that some options might not be present on some systems.
.. versionchanged:: 3.10
Added :data:`MAP_POPULATE` constant. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fd138b05-32e9-4d2d-8972-60e6148b0137 | CPython Docs | file://datasets/cpython/Doc/library/mmap.rst | unknown | 13084950-4349-48cd-839e-57bc6814c258 | 40,031 | supabase-export-v2 | 70770ff471ff4736 | with *access* of :const:`ACCESS_READ` or :const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map created with *trackfd* set to ``False``, will raise a :exc:`ValueError` exception.
**On Windows**: Resizing the map will raise an :exc:`OSError` if there are other
maps against the same named file. Re... | trusted_official_docs | CPython Docs | with *access* of :const:`ACCESS_READ` or :const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map created with *trackfd* set to ``False``, will raise a :exc:`ValueError` exception.
**On Windows**: Resizing the map will raise an :exc:`OSError` if there are other
maps against the same named file. Re... | with *access* of :const:`ACCESS_READ` or :const:`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map created with *trackfd* set to ``False``, will raise a :exc:`ValueError` exception.
**On Windows**: Resizing the map will raise an :exc:`OSError` if there are other
maps against the same named file. Re... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0afd35b5-8458-4e9f-9bad-f373840503d9 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,115 | supabase-export-v2 | 6e0fc818eb0365ff | .. function:: extract_stack(f=None, limit=None)
Extract the raw traceback from the current
:ref:`stack frame <frame-objects>`. The return value has
the same format as for :func:`extract_tb`. The optional *f* and *limit*
arguments have the same meaning as for :func:`print_stack`. | trusted_official_docs | CPython Docs | .. function:: extract_stack(f=None, limit=None)
Extract the raw traceback from the current
:ref:`stack frame <frame-objects>`. The return value has
the same format as for :func:`extract_tb`. The optional *f* and *limit*
arguments have the same meaning as for :func:`print_stack`. | .. function:: extract_stack(f=None, limit=None)
Extract the raw traceback from the current
:ref:`stack frame <frame-objects>`. The return value has
the same format as for :func:`extract_tb`. The optional *f* and *limit*
arguments have the same meaning as for :func:`print_stack`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0fe6f264-8420-416e-aec7-e82a8299a526 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,123 | supabase-export-v2 | 9395c058d7c330e3 | an exception object can be passed as the first argument. If *value* is provided, the first argument is ignored in order to provide backwards compatibility.
When *show_group* is ``True``, and the exception is an instance of
:exc:`BaseExceptionGroup`, the nested exceptions are included as
well, recursively, with indent... | trusted_official_docs | CPython Docs | an exception object can be passed as the first argument. If *value* is provided, the first argument is ignored in order to provide backwards compatibility.
When *show_group* is ``True``, and the exception is an instance of
:exc:`BaseExceptionGroup`, the nested exceptions are included as
well, recursively, with indent... | an exception object can be passed as the first argument. If *value* is provided, the first argument is ignored in order to provide backwards compatibility.
When *show_group* is ``True``, and the exception is an instance of
:exc:`BaseExceptionGroup`, the nested exceptions are included as
well, recursively, with indent... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
141245bb-56eb-42e0-ad6f-b2da8155899d | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,196 | supabase-export-v2 | 37ae9103f8fc2599 | If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will not be formatted.
The return value is a generator of strings, each ending in a newline and
some containing internal newlines. :func:`~traceback.print_exception`
is a wrapper around this method which just prints the lines to a file. | trusted_official_docs | CPython Docs | If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will not be formatted.
The return value is a generator of strings, each ending in a newline and
some containing internal newlines. :func:`~traceback.print_exception`
is a wrapper around this method which just prints the lines to a file. | If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will not be formatted.
The return value is a generator of strings, each ending in a newline and
some containing internal newlines. :func:`~traceback.print_exception`
is a wrapper around this method which just prints the lines to a file. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1d947c3c-ab2c-4a9c-b292-cd3287e6a651 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,255 | supabase-export-v2 | 5c616ee31a06b239 | .. testoutput:: :options: +NORMALIZE_WHITESPACE
*** print_tb:
File "<doctest...>", line 10, in <module>
lumberjack()
~~~~~~~~~~^^
*** print_exception:
Traceback (most recent call last):
File "<doctest...>", line 10, in <module>
lumberjack()
~~~~~~~~~~^^
File "<doctest...>", line 4, in lumberjack
bright_side_o... | trusted_official_docs | CPython Docs | .. testoutput:: :options: +NORMALIZE_WHITESPACE
*** print_tb:
File "<doctest...>", line 10, in <module>
lumberjack()
~~~~~~~~~~^^
*** print_exception:
Traceback (most recent call last):
File "<doctest...>", line 10, in <module>
lumberjack()
~~~~~~~~~~^^
File "<doctest...>", line 4, in lumberjack
bright_side_o... | .. testoutput:: :options: +NORMALIZE_WHITESPACE
*** print_tb:
File "<doctest...>", line 10, in <module>
lumberjack()
~~~~~~~~~~^^
*** print_exception:
Traceback (most recent call last):
File "<doctest...>", line 10, in <module>
lumberjack()
~~~~~~~~~~^^
File "<doctest...>", line 4, in lumberjack
bright_side_o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
21189f2c-acd9-43f3-a863-8718542e91fd | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,142 | supabase-export-v2 | d43b4f80ef44a861 | .. versionadded:: 3.5
.. versionchanged:: 3.14
This function previously returned a generator that would walk the stack
when first iterated over. The generator returned now is the state of the
stack when ``walk_stack`` is called. | trusted_official_docs | CPython Docs | .. versionadded:: 3.5
.. versionchanged:: 3.14
This function previously returned a generator that would walk the stack
when first iterated over. The generator returned now is the state of the
stack when ``walk_stack`` is called. | .. versionadded:: 3.5
.. versionchanged:: 3.14
This function previously returned a generator that would walk the stack
when first iterated over. The generator returned now is the state of the
stack when ``walk_stack`` is called. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
269141f4-f4d9-4b23-834b-81e1d7e8ac87 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,101 | supabase-export-v2 | 56375a270faa0358 | and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error.
Since Python 3.10, instead of passing *value* and *tb*, an exception object
can be passed as the first argument. If *value* and *tb* are provided, the
first argumen... | trusted_official_docs | CPython Docs | and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error.
Since Python 3.10, instead of passing *value* and *tb*, an exception object
can be passed as the first argument. If *value* and *tb* are provided, the
first argumen... | and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error.
Since Python 3.10, instead of passing *value* and *tb*, an exception object
can be passed as the first argument. If *value* and *tb* are provided, the
first argumen... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
280767a2-b9d2-44cf-9e1f-2eff18c8d38c | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,225 | supabase-export-v2 | 04981964979be74f | .. class:: FrameSummary(filename, lineno, name, *,\ lookup_line=True, locals=None,\ line=None, end_lineno=None, colno=None, end_colno=None)
Represents a single :ref:`frame <frame-objects>` in the
:ref:`traceback <traceback-objects>` or stack that is being formatted
or printed. It may optionally have a stringified ver... | trusted_official_docs | CPython Docs | .. class:: FrameSummary(filename, lineno, name, *,\ lookup_line=True, locals=None,\ line=None, end_lineno=None, colno=None, end_colno=None)
Represents a single :ref:`frame <frame-objects>` in the
:ref:`traceback <traceback-objects>` or stack that is being formatted
or printed. It may optionally have a stringified ver... | .. class:: FrameSummary(filename, lineno, name, *,\ lookup_line=True, locals=None,\ line=None, end_lineno=None, colno=None, end_colno=None)
Represents a single :ref:`frame <frame-objects>` in the
:ref:`traceback <traceback-objects>` or stack that is being formatted
or printed. It may optionally have a stringified ver... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b20c66d-62f8-4365-aa13-62ccb32a96c3 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,213 | supabase-export-v2 | d5ef03e1f9447081 | .. classmethod:: from_list(a_list)
Construct a :class:`!StackSummary` object from a supplied list of
:class:`FrameSummary` objects or old-style list of tuples. Each tuple
should be a 4-tuple with *filename*, *lineno*, *name*, *line* as the
elements. | trusted_official_docs | CPython Docs | .. classmethod:: from_list(a_list)
Construct a :class:`!StackSummary` object from a supplied list of
:class:`FrameSummary` objects or old-style list of tuples. Each tuple
should be a 4-tuple with *filename*, *lineno*, *name*, *line* as the
elements. | .. classmethod:: from_list(a_list)
Construct a :class:`!StackSummary` object from a supplied list of
:class:`FrameSummary` objects or old-style list of tuples. Each tuple
should be a 4-tuple with *filename*, *lineno*, *name*, *line* as the
elements. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33c58755-9624-49fb-aad5-f72b11e7f85c | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,121 | supabase-export-v2 | 4d20a58ea8c4ca1e | .. function:: format_exception_only(exc, /[, value], *, show_group=False)
Format the exception part of a traceback using an exception value such as
given by :data:`sys.last_value`. The return value is a list of strings, each
ending in a newline. The list contains the exception's message, which is
normally a single s... | trusted_official_docs | CPython Docs | .. function:: format_exception_only(exc, /[, value], *, show_group=False)
Format the exception part of a traceback using an exception value such as
given by :data:`sys.last_value`. The return value is a list of strings, each
ending in a newline. The list contains the exception's message, which is
normally a single s... | .. function:: format_exception_only(exc, /[, value], *, show_group=False)
Format the exception part of a traceback using an exception value such as
given by :data:`sys.last_value`. The return value is a list of strings, each
ending in a newline. The list contains the exception's message, which is
normally a single s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
36ddbe4e-356b-4259-a5fc-9a205cc94d00 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,265 | supabase-export-v2 | 1a77d92de4531b70 | call last): File "<python-input-1>", line 6, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-1>", line 10, in bright_side_of_life return t[5] ~^^^ IndexError: tuple index out of range
>>> # capture_locals adds local variables in frames
>>> TracebackException.from_exception(exc, limit=-2, ... | trusted_official_docs | CPython Docs | call last): File "<python-input-1>", line 6, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-1>", line 10, in bright_side_of_life return t[5] ~^^^ IndexError: tuple index out of range
>>> # capture_locals adds local variables in frames
>>> TracebackException.from_exception(exc, limit=-2, ... | call last): File "<python-input-1>", line 6, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-1>", line 10, in bright_side_of_life return t[5] ~^^^ IndexError: tuple index out of range
>>> # capture_locals adds local variables in frames
>>> TracebackException.from_exception(exc, limit=-2, ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
38f74252-9a69-41e0-a6b5-4fd9f5bb7c39 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,201 | supabase-export-v2 | 059c780549596f40 | normally a single string; however, for :exc:`SyntaxError` exceptions, it consists of several lines that (when printed) display detailed information about where the syntax error occurred.
When *show_group* is ``True``, and the exception is an instance of
:exc:`BaseExceptionGroup`, the nested exceptions are included as
... | trusted_official_docs | CPython Docs | normally a single string; however, for :exc:`SyntaxError` exceptions, it consists of several lines that (when printed) display detailed information about where the syntax error occurred.
When *show_group* is ``True``, and the exception is an instance of
:exc:`BaseExceptionGroup`, the nested exceptions are included as
... | normally a single string; however, for :exc:`SyntaxError` exceptions, it consists of several lines that (when printed) display detailed information about where the syntax error occurred.
When *show_group* is ``True``, and the exception is an instance of
:exc:`BaseExceptionGroup`, the nested exceptions are included as
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3c8cd44b-8dc2-4282-9806-dfce4556382e | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,219 | supabase-export-v2 | a2347f0fe8686afd | .. method:: format_frame_summary(frame_summary)
Returns a string for printing one of the :ref:`frames <frame-objects>`
involved in the stack. This method is called for each :class:`FrameSummary` object to be
printed by :meth:`StackSummary.format`. If it returns ``None``, the
frame is omitted from the output. | trusted_official_docs | CPython Docs | .. method:: format_frame_summary(frame_summary)
Returns a string for printing one of the :ref:`frames <frame-objects>`
involved in the stack. This method is called for each :class:`FrameSummary` object to be
printed by :meth:`StackSummary.format`. If it returns ``None``, the
frame is omitted from the output. | .. method:: format_frame_summary(frame_summary)
Returns a string for printing one of the :ref:`frames <frame-objects>`
involved in the stack. This method is called for each :class:`FrameSummary` object to be
printed by :meth:`StackSummary.format`. If it returns ``None``, the
frame is omitted from the output. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d3d41a6-badb-4439-8333-d786da9a0ac3 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,226 | supabase-export-v2 | ec969b8e282a15fe | lookups happening at all. *locals* is an optional local variable mapping, and if supplied the variable representations are stored in the summary for later display.
:class:`!FrameSummary` instances have the following attributes: | trusted_official_docs | CPython Docs | lookups happening at all. *locals* is an optional local variable mapping, and if supplied the variable representations are stored in the summary for later display.
:class:`!FrameSummary` instances have the following attributes: | lookups happening at all. *locals* is an optional local variable mapping, and if supplied the variable representations are stored in the summary for later display.
:class:`!FrameSummary` instances have the following attributes: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3da72e68-e2b7-4d38-820f-0cbfc030846c | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,088 | supabase-export-v2 | db11c0d441b2ffed | flexibility in the output generated and the ability to store the information necessary for later formatting without holding references to actual exception and traceback objects.
.. versionadded:: 3.13
Output is colorized by default and can be
:ref:`controlled using environment variables <using-on-controlling-color>`. | trusted_official_docs | CPython Docs | flexibility in the output generated and the ability to store the information necessary for later formatting without holding references to actual exception and traceback objects.
.. versionadded:: 3.13
Output is colorized by default and can be
:ref:`controlled using environment variables <using-on-controlling-color>`. | flexibility in the output generated and the ability to store the information necessary for later formatting without holding references to actual exception and traceback objects.
.. versionadded:: 3.13
Output is colorized by default and can be
:ref:`controlled using environment variables <using-on-controlling-color>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
46edf31e-b68a-46f4-9a0a-83ab16a3eea4 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,257 | supabase-export-v2 | 3d3b3d1c66a5893e | The following example shows the different ways to print and format the stack::
>>> import traceback
>>> def another_function():
... lumberstack()
... >>> def lumberstack():
... traceback.print_stack()
... print(repr(traceback.extract_stack()))
... print(repr(traceback.format_stack()))
... | trusted_official_docs | CPython Docs | The following example shows the different ways to print and format the stack::
>>> import traceback
>>> def another_function():
... lumberstack()
... >>> def lumberstack():
... traceback.print_stack()
... print(repr(traceback.extract_stack()))
... print(repr(traceback.format_stack()))
... | The following example shows the different ways to print and format the stack::
>>> import traceback
>>> def another_function():
... lumberstack()
... >>> def lumberstack():
... traceback.print_stack()
... print(repr(traceback.extract_stack()))
... print(repr(traceback.format_stack()))
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4db51e20-b3f4-4c76-8f5d-8b40ccb1411f | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,216 | supabase-export-v2 | 14b6f1a0fff588a5 | <frame-objects>` from the stack. Each string ends in a newline; the strings may contain internal newlines as well, for those items with source text lines.
For long sequences of the same frame and line, the first few
repetitions are shown, followed by a summary line stating the exact
number of further repetitions. | trusted_official_docs | CPython Docs | <frame-objects>` from the stack. Each string ends in a newline; the strings may contain internal newlines as well, for those items with source text lines.
For long sequences of the same frame and line, the first few
repetitions are shown, followed by a summary line stating the exact
number of further repetitions. | <frame-objects>` from the stack. Each string ends in a newline; the strings may contain internal newlines as well, for those items with source text lines.
For long sequences of the same frame and line, the first few
repetitions are shown, followed by a summary line stating the exact
number of further repetitions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ef2afed-71dc-48aa-a1f8-946e3ff4dda5 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,154 | supabase-export-v2 | 9b8d5749023c0c66 | group, and the width refers to the size of a single exception group's exceptions array. The formatted output is truncated when either limit is exceeded.
.. versionchanged:: 3.10
Added the *compact* parameter. | trusted_official_docs | CPython Docs | group, and the width refers to the size of a single exception group's exceptions array. The formatted output is truncated when either limit is exceeded.
.. versionchanged:: 3.10
Added the *compact* parameter. | group, and the width refers to the size of a single exception group's exceptions array. The formatted output is truncated when either limit is exceeded.
.. versionchanged:: 3.10
Added the *compact* parameter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52d62d49-a61d-4d49-939d-170df021409e | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,256 | supabase-export-v2 | 7ba4fa87bcb7307d | ~~~~~~~~~~^^\n', ' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n ~~~~~~~~~~~~~~~~~~~^^\n', ' File "<doctest default[0]>", line 7, in bright_side_of_life\n return tuple()[0]\n ~~~~~~~^^^\n'] *** tb_lineno: 10
The following example shows the different ways to print and format the stack:: | trusted_official_docs | CPython Docs | ~~~~~~~~~~^^\n', ' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n ~~~~~~~~~~~~~~~~~~~^^\n', ' File "<doctest default[0]>", line 7, in bright_side_of_life\n return tuple()[0]\n ~~~~~~~^^^\n'] *** tb_lineno: 10
The following example shows the different ways to print and format the stack:: | ~~~~~~~~~~^^\n', ' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n ~~~~~~~~~~~~~~~~~~~^^\n', ' File "<doctest default[0]>", line 7, in bright_side_of_life\n return tuple()[0]\n ~~~~~~~^^^\n'] *** tb_lineno: 10
The following example shows the different ways to print and format the stack:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
539d5b5d-e723-4550-8ad8-8623d92a6747 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,237 | supabase-export-v2 | dfbdc5458ed7964a | The last line number of the source code for this frame. By default, it is set to ``lineno`` and indexation starts from 1.
.. versionchanged:: 3.13
The default value changed from ``None`` to ``lineno``. | trusted_official_docs | CPython Docs | The last line number of the source code for this frame. By default, it is set to ``lineno`` and indexation starts from 1.
.. versionchanged:: 3.13
The default value changed from ``None`` to ``lineno``. | The last line number of the source code for this frame. By default, it is set to ``lineno`` and indexation starts from 1.
.. versionchanged:: 3.13
The default value changed from ``None`` to ``lineno``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
55ed59d1-149b-457f-9134-45a235d141fb | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,102 | supabase-export-v2 | 2af17a0f666409aa | object can be passed as the first argument. If *value* and *tb* are provided, the first argument is ignored in order to provide backwards compatibility.
The optional *limit* argument has the same meaning as for :func:`print_tb`. If *chain* is true (the default), then chained exceptions (the
:attr:`~BaseException.__cau... | trusted_official_docs | CPython Docs | object can be passed as the first argument. If *value* and *tb* are provided, the first argument is ignored in order to provide backwards compatibility.
The optional *limit* argument has the same meaning as for :func:`print_tb`. If *chain* is true (the default), then chained exceptions (the
:attr:`~BaseException.__cau... | object can be passed as the first argument. If *value* and *tb* are provided, the first argument is ignored in order to provide backwards compatibility.
The optional *limit* argument has the same meaning as for :func:`print_tb`. If *chain* is true (the default), then chained exceptions (the
:attr:`~BaseException.__cau... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
562b7866-c689-40a9-9cd3-51ffdb008c4c | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,267 | supabase-export-v2 | 177f742624f4e273 | lumberjack() ~~~~~~~~~~^^ File "<python-input-8>", line 7, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-8>", line 11, in bright_side_of_life return t[5] ~^^^ IndexError: tuple index out of range
During handling of the above exception, another exception occurred: | trusted_official_docs | CPython Docs | lumberjack() ~~~~~~~~~~^^ File "<python-input-8>", line 7, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-8>", line 11, in bright_side_of_life return t[5] ~^^^ IndexError: tuple index out of range
During handling of the above exception, another exception occurred: | lumberjack() ~~~~~~~~~~^^ File "<python-input-8>", line 7, in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-8>", line 11, in bright_side_of_life return t[5] ~^^^ IndexError: tuple index out of range
During handling of the above exception, another exception occurred: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
58308c14-7355-425b-a202-11fabc03ccf6 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,109 | supabase-export-v2 | 4b1214dbc42b041f | This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file, chain=chain)``. In general it will work only after an exception has reached an interactive prompt (see :data:`sys.last_exc`).
.. function:: print_stack(f=None, limit=None, file=None) | trusted_official_docs | CPython Docs | This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file, chain=chain)``. In general it will work only after an exception has reached an interactive prompt (see :data:`sys.last_exc`).
.. function:: print_stack(f=None, limit=None, file=None) | This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file, chain=chain)``. In general it will work only after an exception has reached an interactive prompt (see :data:`sys.last_exc`).
.. function:: print_stack(f=None, limit=None, file=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
599b8b5f-06e0-427c-80bd-55b390472bf7 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,110 | supabase-export-v2 | a18ed4bbc9969a13 | .. function:: print_stack(f=None, limit=None, file=None)
Print up to *limit* stack trace entries (starting from the invocation
point) if *limit* is positive. Otherwise, print the last ``abs(limit)``
entries. If *limit* is omitted or ``None``, all entries are printed. The optional *f* argument can be used to specify a... | trusted_official_docs | CPython Docs | .. function:: print_stack(f=None, limit=None, file=None)
Print up to *limit* stack trace entries (starting from the invocation
point) if *limit* is positive. Otherwise, print the last ``abs(limit)``
entries. If *limit* is omitted or ``None``, all entries are printed. The optional *f* argument can be used to specify a... | .. function:: print_stack(f=None, limit=None, file=None)
Print up to *limit* stack trace entries (starting from the invocation
point) if *limit* is positive. Otherwise, print the last ``abs(limit)``
entries. If *limit* is omitted or ``None``, all entries are printed. The optional *f* argument can be used to specify a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5b68928c-97af-4728-9921-fe0d0e9ee9d4 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,244 | supabase-export-v2 | ad2385654d58c44f | Examples of Using the Module-Level Functions --------------------------------------------
This simple example implements a basic read-eval-print loop, similar to (but
less useful than) the standard Python interactive interpreter loop. For a more
complete implementation of the interpreter loop, refer to the :mod:`code`
... | trusted_official_docs | CPython Docs | Examples of Using the Module-Level Functions --------------------------------------------
This simple example implements a basic read-eval-print loop, similar to (but
less useful than) the standard Python interactive interpreter loop. For a more
complete implementation of the interpreter loop, refer to the :mod:`code`
... | Examples of Using the Module-Level Functions --------------------------------------------
This simple example implements a basic read-eval-print loop, similar to (but
less useful than) the standard Python interactive interpreter loop. For a more
complete implementation of the interpreter loop, refer to the :mod:`code`
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5b9dd2d5-c348-481d-b3b4-74cc4078ea01 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,128 | supabase-export-v2 | d0df35151b2ff70d | .. function:: format_exception(exc, /[, value, tb], limit=None, chain=True)
Format a stack trace and the exception information. The arguments have the
same meaning as the corresponding arguments to :func:`print_exception`. The
return value is a list of strings, each ending in a newline and some
containing internal n... | trusted_official_docs | CPython Docs | .. function:: format_exception(exc, /[, value, tb], limit=None, chain=True)
Format a stack trace and the exception information. The arguments have the
same meaning as the corresponding arguments to :func:`print_exception`. The
return value is a list of strings, each ending in a newline and some
containing internal n... | .. function:: format_exception(exc, /[, value, tb], limit=None, chain=True)
Format a stack trace and the exception information. The arguments have the
same meaning as the corresponding arguments to :func:`print_exception`. The
return value is a list of strings, each ending in a newline and some
containing internal n... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5bbeb86a-f413-477e-8869-5c4f9fac03e9 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,093 | supabase-export-v2 | cc6c05eefb3a9076 | .. note::
The meaning of the *limit* parameter is different than the meaning
of :const:`sys.tracebacklimit`. A negative *limit* value corresponds to
a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of
a positive *limit* value cannot be achieved with
:const:`!sys.tracebacklimit`. | trusted_official_docs | CPython Docs | .. note::
The meaning of the *limit* parameter is different than the meaning
of :const:`sys.tracebacklimit`. A negative *limit* value corresponds to
a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of
a positive *limit* value cannot be achieved with
:const:`!sys.tracebacklimit`. | .. note::
The meaning of the *limit* parameter is different than the meaning
of :const:`sys.tracebacklimit`. A negative *limit* value corresponds to
a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of
a positive *limit* value cannot be achieved with
:const:`!sys.tracebacklimit`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5d9190b9-038c-435b-bb1d-2a2f7c4880f6 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,202 | supabase-export-v2 | d12af15484a216f6 | is ``True``, and the exception is an instance of :exc:`BaseExceptionGroup`, the nested exceptions are included as well, recursively, with indentation relative to their nesting depth.
.. versionchanged:: 3.11
The exception's :attr:`notes <BaseException.__notes__>` are now
included in the output. | trusted_official_docs | CPython Docs | is ``True``, and the exception is an instance of :exc:`BaseExceptionGroup`, the nested exceptions are included as well, recursively, with indentation relative to their nesting depth.
.. versionchanged:: 3.11
The exception's :attr:`notes <BaseException.__notes__>` are now
included in the output. | is ``True``, and the exception is an instance of :exc:`BaseExceptionGroup`, the nested exceptions are included as well, recursively, with indentation relative to their nesting depth.
.. versionchanged:: 3.11
The exception's :attr:`notes <BaseException.__notes__>` are now
included in the output. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5f4b95e2-3f00-4732-9707-cdba133572b2 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,104 | supabase-export-v2 | 73bd0e1d2a8234b6 | .. versionchanged:: 3.5 The *etype* argument is ignored and inferred from the type of *value*.
.. versionchanged:: 3.10
The *etype* parameter has been renamed to *exc* and is now
positional-only. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.5 The *etype* argument is ignored and inferred from the type of *value*.
.. versionchanged:: 3.10
The *etype* parameter has been renamed to *exc* and is now
positional-only. | .. versionchanged:: 3.5 The *etype* argument is ignored and inferred from the type of *value*.
.. versionchanged:: 3.10
The *etype* parameter has been renamed to *exc* and is now
positional-only. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
644c1432-8805-4f0e-8e8d-e7ecb26b0227 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,125 | supabase-export-v2 | 4e6d3622888a8711 | .. versionchanged:: 3.10 The *etype* parameter has been renamed to *exc* and is now positional-only.
.. versionchanged:: 3.11
The returned list now includes any
:attr:`notes <BaseException.__notes__>` attached to the exception. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.10 The *etype* parameter has been renamed to *exc* and is now positional-only.
.. versionchanged:: 3.11
The returned list now includes any
:attr:`notes <BaseException.__notes__>` attached to the exception. | .. versionchanged:: 3.10 The *etype* parameter has been renamed to *exc* and is now positional-only.
.. versionchanged:: 3.11
The returned list now includes any
:attr:`notes <BaseException.__notes__>` attached to the exception. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
684f220f-a6c8-4ccb-861f-0d2763745797 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,096 | supabase-export-v2 | 4e33b0ba1ab2fd22 | .. function:: print_exception(exc, /[, value, tb], limit=None, \ file=None, chain=True)
Print exception information and stack trace entries from
:ref:`traceback object <traceback-objects>`
*tb* to *file*. This differs from :func:`print_tb` in the following
ways: | trusted_official_docs | CPython Docs | .. function:: print_exception(exc, /[, value, tb], limit=None, \ file=None, chain=True)
Print exception information and stack trace entries from
:ref:`traceback object <traceback-objects>`
*tb* to *file*. This differs from :func:`print_tb` in the following
ways: | .. function:: print_exception(exc, /[, value, tb], limit=None, \ file=None, chain=True)
Print exception information and stack trace entries from
:ref:`traceback object <traceback-objects>`
*tb* to *file*. This differs from :func:`print_tb` in the following
ways: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6890b033-6066-487a-bc0d-213e98be4729 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,210 | supabase-export-v2 | 48d411fb74ffd94c | Construct a :class:`!StackSummary` object from a frame generator (such as is returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`).
If *limit* is supplied, only this many frames are taken from *frame_gen*. If *lookup_lines* is ``False``, the returned :class:`FrameSummary`
objects will not have read ... | trusted_official_docs | CPython Docs | Construct a :class:`!StackSummary` object from a frame generator (such as is returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`).
If *limit* is supplied, only this many frames are taken from *frame_gen*. If *lookup_lines* is ``False``, the returned :class:`FrameSummary`
objects will not have read ... | Construct a :class:`!StackSummary` object from a frame generator (such as is returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`).
If *limit* is supplied, only this many frames are taken from *frame_gen*. If *lookup_lines* is ``False``, the returned :class:`FrameSummary`
objects will not have read ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
69e73d0a-dc93-47a4-876f-4e7530f2d189 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,129 | supabase-export-v2 | 99d360fac97500f1 | ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does :func:`print_exception`.
.. versionchanged:: 3.5
The *etype* argument is ignored and inferred from the type of *value*. | trusted_official_docs | CPython Docs | ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does :func:`print_exception`.
.. versionchanged:: 3.5
The *etype* argument is ignored and inferred from the type of *value*. | ending in a newline and some containing internal newlines. When these lines are concatenated and printed, exactly the same text is printed as does :func:`print_exception`.
.. versionchanged:: 3.5
The *etype* argument is ignored and inferred from the type of *value*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
713d89ab-4963-415e-a943-9036a18e3546 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,119 | supabase-export-v2 | e31891050ebe9ce0 | .. function:: format_list(extracted_list)
Given a list of tuples or :class:`FrameSummary` objects as returned by
:func:`extract_tb` or :func:`extract_stack`, return a list of strings ready
for printing. Each string in the resulting list corresponds to the item with
the same index in the argument list. Each string en... | trusted_official_docs | CPython Docs | .. function:: format_list(extracted_list)
Given a list of tuples or :class:`FrameSummary` objects as returned by
:func:`extract_tb` or :func:`extract_stack`, return a list of strings ready
for printing. Each string in the resulting list corresponds to the item with
the same index in the argument list. Each string en... | .. function:: format_list(extracted_list)
Given a list of tuples or :class:`FrameSummary` objects as returned by
:func:`extract_tb` or :func:`extract_stack`, return a list of strings ready
for printing. Each string in the resulting list corresponds to the item with
the same index in the argument list. Each string en... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
728f59ce-ef48-462f-9c0f-238d3bc8a6d7 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,266 | supabase-export-v2 | 114f2274c64d940c | in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-1>", line 10, in bright_side_of_life return t[5] ~^^^ t = ("bright", "side", "of", "life") IndexError: tuple index out of range
>>> # The *chain* kwarg to print() controls whether chained
>>> # exceptions are displayed
>>> TracebackExceptio... | trusted_official_docs | CPython Docs | in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-1>", line 10, in bright_side_of_life return t[5] ~^^^ t = ("bright", "side", "of", "life") IndexError: tuple index out of range
>>> # The *chain* kwarg to print() controls whether chained
>>> # exceptions are displayed
>>> TracebackExceptio... | in lumberjack bright_side_of_life() ~~~~~~~~~~~~~~~~~~~^^ File "<python-input-1>", line 10, in bright_side_of_life return t[5] ~^^^ t = ("bright", "side", "of", "life") IndexError: tuple index out of range
>>> # The *chain* kwarg to print() controls whether chained
>>> # exceptions are displayed
>>> TracebackExceptio... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7590e42f-9b97-4032-a128-e80bc69d7f6b | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,166 | supabase-export-v2 | c6c48006d16dfa1f | .. attribute:: __notes__
The :attr:`~BaseException.__notes__` value from the original exception,
or ``None``
if the exception does not have any notes. If it is not ``None``
is it formatted in the traceback after the exception string. | trusted_official_docs | CPython Docs | .. attribute:: __notes__
The :attr:`~BaseException.__notes__` value from the original exception,
or ``None``
if the exception does not have any notes. If it is not ``None``
is it formatted in the traceback after the exception string. | .. attribute:: __notes__
The :attr:`~BaseException.__notes__` value from the original exception,
or ``None``
if the exception does not have any notes. If it is not ``None``
is it formatted in the traceback after the exception string. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7af95bac-8d0d-4f78-a73d-4d93a77fe845 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,269 | supabase-export-v2 | 84e8ee8282c0389e | Traceback (most recent call last): File "<python-input-19>", line 6, in <module> 1/0 ~^~ ZeroDivisionError: division by zero
>>> TracebackException.from_exception(chained_exc).print(chain=False)
Traceback (most recent call last):
File "<python-input-19>", line 6, in <module>
1/0
~^~
ZeroDivisionError: division by ... | trusted_official_docs | CPython Docs | Traceback (most recent call last): File "<python-input-19>", line 6, in <module> 1/0 ~^~ ZeroDivisionError: division by zero
>>> TracebackException.from_exception(chained_exc).print(chain=False)
Traceback (most recent call last):
File "<python-input-19>", line 6, in <module>
1/0
~^~
ZeroDivisionError: division by ... | Traceback (most recent call last): File "<python-input-19>", line 6, in <module> 1/0 ~^~ ZeroDivisionError: division by zero
>>> TracebackException.from_exception(chained_exc).print(chain=False)
Traceback (most recent call last):
File "<python-input-19>", line 6, in <module>
1/0
~^~
ZeroDivisionError: division by ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7b06e13e-efb7-40ad-a043-e853f3864252 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,215 | supabase-export-v2 | bc9f91ae61e1541b | .. method:: format()
Returns a list of strings ready for printing. Each string in the
resulting list corresponds to a single :ref:`frame <frame-objects>` from
the stack. Each string ends in a newline; the strings may contain internal
newlines as well, for those items with source text lines. | trusted_official_docs | CPython Docs | .. method:: format()
Returns a list of strings ready for printing. Each string in the
resulting list corresponds to a single :ref:`frame <frame-objects>` from
the stack. Each string ends in a newline; the strings may contain internal
newlines as well, for those items with source text lines. | .. method:: format()
Returns a list of strings ready for printing. Each string in the
resulting list corresponds to a single :ref:`frame <frame-objects>` from
the stack. Each string ends in a newline; the strings may contain internal
newlines as well, for those items with source text lines. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83d0d2df-6c67-4f03-85cd-11bf0b6b30ba | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,140 | supabase-export-v2 | b19626e199f20959 | .. function:: walk_stack(f)
Walk a stack following :attr:`f.f_back <frame.f_back>` from the given frame,
yielding the frame
and line number for each frame. If *f* is ``None``, the current stack is
used. This helper is used with :meth:`StackSummary.extract`. | trusted_official_docs | CPython Docs | .. function:: walk_stack(f)
Walk a stack following :attr:`f.f_back <frame.f_back>` from the given frame,
yielding the frame
and line number for each frame. If *f* is ``None``, the current stack is
used. This helper is used with :meth:`StackSummary.extract`. | .. function:: walk_stack(f)
Walk a stack following :attr:`f.f_back <frame.f_back>` from the given frame,
yielding the frame
and line number for each frame. If *f* is ``None``, the current stack is
used. This helper is used with :meth:`StackSummary.extract`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8df988fa-e39f-45e0-a048-03dd0ae8b6c2 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,150 | supabase-export-v2 | 72a67b9aa789878a | .. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10)
Capture an exception for later rendering. The meaning of *limit*,
*lookup_lines* and *capture_locals* are as for the :class:`StackSummary`
cl... | trusted_official_docs | CPython Docs | .. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10)
Capture an exception for later rendering. The meaning of *limit*,
*lookup_lines* and *capture_locals* are as for the :class:`StackSummary`
cl... | .. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10)
Capture an exception for later rendering. The meaning of *limit*,
*lookup_lines* and *capture_locals* are as for the :class:`StackSummary`
cl... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
942b89a2-aa94-4d4d-b623-4b994c939a49 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,124 | supabase-export-v2 | 1df86c156db6f3c8 | is ``True``, and the exception is an instance of :exc:`BaseExceptionGroup`, the nested exceptions are included as well, recursively, with indentation relative to their nesting depth.
.. versionchanged:: 3.10
The *etype* parameter has been renamed to *exc* and is now
positional-only. | trusted_official_docs | CPython Docs | is ``True``, and the exception is an instance of :exc:`BaseExceptionGroup`, the nested exceptions are included as well, recursively, with indentation relative to their nesting depth.
.. versionchanged:: 3.10
The *etype* parameter has been renamed to *exc* and is now
positional-only. | is ``True``, and the exception is an instance of :exc:`BaseExceptionGroup`, the nested exceptions are included as well, recursively, with indentation relative to their nesting depth.
.. versionchanged:: 3.10
The *etype* parameter has been renamed to *exc* and is now
positional-only. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9bb032d6-5606-4ab6-803f-66165274ad5b | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,080 | supabase-export-v2 | 45e9c60827bf4158 | to save a reference to the actual exception. Since exceptions can be the roots of large objects graph, this utility can significantly improve memory management.
.. index:: pair: object; traceback | trusted_official_docs | CPython Docs | to save a reference to the actual exception. Since exceptions can be the roots of large objects graph, this utility can significantly improve memory management.
.. index:: pair: object; traceback | to save a reference to the actual exception. Since exceptions can be the roots of large objects graph, this utility can significantly improve memory management.
.. index:: pair: object; traceback | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a10e9cd9-6297-4aa8-8695-b0e6b5d11a21 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,152 | supabase-export-v2 | 62af84d3c7d8ab17 | :class:`!TracebackException`'s :meth:`format` method is saved in the class attributes. In particular, the :attr:`__context__` field is calculated only if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false.
Note that when locals are captured, they are also shown in the traceback. | trusted_official_docs | CPython Docs | :class:`!TracebackException`'s :meth:`format` method is saved in the class attributes. In particular, the :attr:`__context__` field is calculated only if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false.
Note that when locals are captured, they are also shown in the traceback. | :class:`!TracebackException`'s :meth:`format` method is saved in the class attributes. In particular, the :attr:`__context__` field is calculated only if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false.
Note that when locals are captured, they are also shown in the traceback. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a6c1b291-aebe-4c5e-a641-9daec5e126c9 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,094 | supabase-export-v2 | 11e11ff44f947944 | :const:`sys.tracebacklimit`. A negative *limit* value corresponds to a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of a positive *limit* value cannot be achieved with :const:`!sys.tracebacklimit`.
.. versionchanged:: 3.5
Added negative *limit* support. | trusted_official_docs | CPython Docs | :const:`sys.tracebacklimit`. A negative *limit* value corresponds to a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of a positive *limit* value cannot be achieved with :const:`!sys.tracebacklimit`.
.. versionchanged:: 3.5
Added negative *limit* support. | :const:`sys.tracebacklimit`. A negative *limit* value corresponds to a positive value of :const:`!sys.tracebacklimit`, whereas the behaviour of a positive *limit* value cannot be achieved with :const:`!sys.tracebacklimit`.
.. versionchanged:: 3.5
Added negative *limit* support. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ada94d8a-208b-4852-a9d3-0668f436006d | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,148 | supabase-export-v2 | 9411d1bd5fc76036 | .. versionadded:: 3.5
:class:`!TracebackException` objects are created from actual exceptions to
capture data for later printing. They offer a more lightweight method of
storing this information by avoiding holding references to
:ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In addition, t... | trusted_official_docs | CPython Docs | .. versionadded:: 3.5
:class:`!TracebackException` objects are created from actual exceptions to
capture data for later printing. They offer a more lightweight method of
storing this information by avoiding holding references to
:ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In addition, t... | .. versionadded:: 3.5
:class:`!TracebackException` objects are created from actual exceptions to
capture data for later printing. They offer a more lightweight method of
storing this information by avoiding holding references to
:ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In addition, t... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aef59cb5-78a7-4aba-86e5-d702e64d8fa7 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,258 | supabase-export-v2 | ca59d8b9b98adb09 | >>> import traceback >>> def another_function(): ... lumberstack() ... >>> def lumberstack(): ... traceback.print_stack() ... print(repr(traceback.extract_stack())) ... print(repr(traceback.format_stack())) ...
>>> another_function()
File "<doctest>", line 10, in <module>
another_function()
File "<doctest>", line 3,... | trusted_official_docs | CPython Docs | >>> import traceback >>> def another_function(): ... lumberstack() ... >>> def lumberstack(): ... traceback.print_stack() ... print(repr(traceback.extract_stack())) ... print(repr(traceback.format_stack())) ...
>>> another_function()
File "<doctest>", line 10, in <module>
another_function()
File "<doctest>", line 3,... | >>> import traceback >>> def another_function(): ... lumberstack() ... >>> def lumberstack(): ... traceback.print_stack() ... print(repr(traceback.extract_stack())) ... print(repr(traceback.format_stack())) ...
>>> another_function()
File "<doctest>", line 10, in <module>
another_function()
File "<doctest>", line 3,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
afe82366-735e-4287-a700-8d7702ef20c0 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,108 | supabase-export-v2 | 59f43458dfe1d04f | .. function:: print_last(limit=None, file=None, chain=True)
This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file,
chain=chain)``. In general it will work only after an exception has reached
an interactive prompt (see :data:`sys.last_exc`). | trusted_official_docs | CPython Docs | .. function:: print_last(limit=None, file=None, chain=True)
This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file,
chain=chain)``. In general it will work only after an exception has reached
an interactive prompt (see :data:`sys.last_exc`). | .. function:: print_last(limit=None, file=None, chain=True)
This is a shorthand for ``print_exception(sys.last_exc, limit=limit, file=file,
chain=chain)``. In general it will work only after an exception has reached
an interactive prompt (see :data:`sys.last_exc`). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bdd97a8a-c2ed-43fb-942b-f85ab1c94f49 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,149 | supabase-export-v2 | 628eba5084a53353 | avoiding holding references to :ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In addition, they expose more options to configure the output compared to the module-level functions described above.
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=... | trusted_official_docs | CPython Docs | avoiding holding references to :ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In addition, they expose more options to configure the output compared to the module-level functions described above.
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=... | avoiding holding references to :ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects. In addition, they expose more options to configure the output compared to the module-level functions described above.
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bf43cb2a-4279-45fe-9b23-cb4647ef4a5a | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,217 | supabase-export-v2 | 73f1480eccff7766 | sequences of the same frame and line, the first few repetitions are shown, followed by a summary line stating the exact number of further repetitions.
.. versionchanged:: 3.6
Long sequences of repeated frames are now abbreviated. | trusted_official_docs | CPython Docs | sequences of the same frame and line, the first few repetitions are shown, followed by a summary line stating the exact number of further repetitions.
.. versionchanged:: 3.6
Long sequences of repeated frames are now abbreviated. | sequences of the same frame and line, the first few repetitions are shown, followed by a summary line stating the exact number of further repetitions.
.. versionchanged:: 3.6
Long sequences of repeated frames are now abbreviated. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bfea2ccf-6e2b-4487-854a-174864846c5d | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,264 | supabase-export-v2 | 81f118622474cb1a | With the helper class, we have more options::
>>> import sys
>>> from traceback import TracebackException
>>>
>>> def lumberjack():
... bright_side_of_life()
... >>> def bright_side_of_life():
... t = "bright", "side", "of", "life"
... return t[5]
... >>> try:
... lumberjack()
... except IndexError as e:
...... | trusted_official_docs | CPython Docs | With the helper class, we have more options::
>>> import sys
>>> from traceback import TracebackException
>>>
>>> def lumberjack():
... bright_side_of_life()
... >>> def bright_side_of_life():
... t = "bright", "side", "of", "life"
... return t[5]
... >>> try:
... lumberjack()
... except IndexError as e:
...... | With the helper class, we have more options::
>>> import sys
>>> from traceback import TracebackException
>>>
>>> def lumberjack():
... bright_side_of_life()
... >>> def bright_side_of_life():
... t = "bright", "side", "of", "life"
... return t[5]
... >>> try:
... lumberjack()
... except IndexError as e:
...... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0a85978-33ce-4948-9ba7-816e8dab83e2 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,252 | supabase-export-v2 | 3671f9e7d3a4a0f7 | def bright_side_of_life(): return tuple()[0]
try:
lumberjack()
except IndexError as exc:
print("*** print_tb:")
traceback.print_tb(exc.__traceback__, limit=1, file=sys.stdout)
print("*** print_exception:")
traceback.print_exception(exc, limit=2, file=sys.stdout)
print("*** print_exc:")
traceback.print_exc(limit... | trusted_official_docs | CPython Docs | def bright_side_of_life(): return tuple()[0]
try:
lumberjack()
except IndexError as exc:
print("*** print_tb:")
traceback.print_tb(exc.__traceback__, limit=1, file=sys.stdout)
print("*** print_exception:")
traceback.print_exception(exc, limit=2, file=sys.stdout)
print("*** print_exc:")
traceback.print_exc(limit... | def bright_side_of_life(): return tuple()[0]
try:
lumberjack()
except IndexError as exc:
print("*** print_tb:")
traceback.print_tb(exc.__traceback__, limit=1, file=sys.stdout)
print("*** print_exception:")
traceback.print_exception(exc, limit=2, file=sys.stdout)
print("*** print_exc:")
traceback.print_exc(limit... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c2866466-0efd-42c9-9ea6-2bdedb399193 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,079 | supabase-export-v2 | 584b3574b3de472e | --------------
This module provides a standard interface to extract, format and print
stack traces of Python programs. It is more flexible than the
interpreter's default traceback display, and therefore makes it
possible to configure certain aspects of the output. Finally,
it contains a utility for capturing enough inf... | trusted_official_docs | CPython Docs | --------------
This module provides a standard interface to extract, format and print
stack traces of Python programs. It is more flexible than the
interpreter's default traceback display, and therefore makes it
possible to configure certain aspects of the output. Finally,
it contains a utility for capturing enough inf... | --------------
This module provides a standard interface to extract, format and print
stack traces of Python programs. It is more flexible than the
interpreter's default traceback display, and therefore makes it
possible to configure certain aspects of the output. Finally,
it contains a utility for capturing enough inf... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c469476b-3879-4cae-b79f-b3c9ce230093 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,200 | supabase-export-v2 | dfea9de33d3d1aa4 | The return value is a generator of strings, each ending in a newline.
When *show_group* is ``False``, the generator emits the exception's
message followed by its notes (if it has any). The exception message
is normally a single string; however, for :exc:`SyntaxError` exceptions,
it consists of several lines that (wh... | trusted_official_docs | CPython Docs | The return value is a generator of strings, each ending in a newline.
When *show_group* is ``False``, the generator emits the exception's
message followed by its notes (if it has any). The exception message
is normally a single string; however, for :exc:`SyntaxError` exceptions,
it consists of several lines that (wh... | The return value is a generator of strings, each ending in a newline.
When *show_group* is ``False``, the generator emits the exception's
message followed by its notes (if it has any). The exception message
is normally a single string; however, for :exc:`SyntaxError` exceptions,
it consists of several lines that (wh... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c797f3f4-d2dd-4008-a978-f42b517209da | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,091 | supabase-export-v2 | d56ed8555840073f | .. function:: print_tb(tb, limit=None, file=None)
Print up to *limit* stack trace entries from
:ref:`traceback object <traceback-objects>` *tb* (starting
from the caller's frame) if *limit* is positive. Otherwise, print the last
``abs(limit)`` entries. If *limit* is omitted or ``None``, all entries are
printed. If ... | trusted_official_docs | CPython Docs | .. function:: print_tb(tb, limit=None, file=None)
Print up to *limit* stack trace entries from
:ref:`traceback object <traceback-objects>` *tb* (starting
from the caller's frame) if *limit* is positive. Otherwise, print the last
``abs(limit)`` entries. If *limit* is omitted or ``None``, all entries are
printed. If ... | .. function:: print_tb(tb, limit=None, file=None)
Print up to *limit* stack trace entries from
:ref:`traceback object <traceback-objects>` *tb* (starting
from the caller's frame) if *limit* is positive. Otherwise, print the last
``abs(limit)`` entries. If *limit* is omitted or ``None``, all entries are
printed. If ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c986d023-84fe-4cd8-9424-8037632fe897 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,120 | supabase-export-v2 | 6b8d3bb28efe01a0 | list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not ``None``.
.. function:: format_exception_only(exc, /[, value], *, show_group=False) | trusted_official_docs | CPython Docs | list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not ``None``.
.. function:: format_exception_only(exc, /[, value], *, show_group=False) | list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line is not ``None``.
.. function:: format_exception_only(exc, /[, value], *, show_group=False) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ca276741-be2c-42c6-a919-06303b02034c | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,259 | supabase-export-v2 | 33814268f5dfb855 | 'print(repr(traceback.extract_stack()))')] [' File "<doctest>", line 10, in <module>\n another_function()\n', ' File "<doctest>", line 3, in another_function\n lumberstack()\n', ' File "<doctest>", line 8, in lumberstack\n print(repr(traceback.format_stack()))\n']
This last example demonstrates the final few formatting... | trusted_official_docs | CPython Docs | 'print(repr(traceback.extract_stack()))')] [' File "<doctest>", line 10, in <module>\n another_function()\n', ' File "<doctest>", line 3, in another_function\n lumberstack()\n', ' File "<doctest>", line 8, in lumberstack\n print(repr(traceback.format_stack()))\n']
This last example demonstrates the final few formatting... | 'print(repr(traceback.extract_stack()))')] [' File "<doctest>", line 10, in <module>\n another_function()\n', ' File "<doctest>", line 3, in another_function\n lumberstack()\n', ' File "<doctest>", line 8, in lumberstack\n print(repr(traceback.format_stack()))\n']
This last example demonstrates the final few formatting... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d5294f37-f701-4cfb-a12a-0f2811f8aaaa | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,151 | supabase-export-v2 | cc17ce632c44ef97 | Capture an exception for later rendering. The meaning of *limit*, *lookup_lines* and *capture_locals* are as for the :class:`StackSummary` class.
If *compact* is true, only data that is required by
:class:`!TracebackException`'s :meth:`format` method
is saved in the class attributes. In particular, the
:attr:`__cont... | trusted_official_docs | CPython Docs | Capture an exception for later rendering. The meaning of *limit*, *lookup_lines* and *capture_locals* are as for the :class:`StackSummary` class.
If *compact* is true, only data that is required by
:class:`!TracebackException`'s :meth:`format` method
is saved in the class attributes. In particular, the
:attr:`__cont... | Capture an exception for later rendering. The meaning of *limit*, *lookup_lines* and *capture_locals* are as for the :class:`StackSummary` class.
If *compact* is true, only data that is required by
:class:`!TracebackException`'s :meth:`format` method
is saved in the class attributes. In particular, the
:attr:`__cont... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d5509a6e-90ca-480d-8347-d9ea3e23846e | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,253 | supabase-export-v2 | 268e3a45e6f1838c | traceback.print_exc(limit=2, file=sys.stdout) print("*** format_exc, first and last line:") formatted_lines = traceback.format_exc().splitlines() print(formatted_lines[0]) print(formatted_lines[-1]) print("*** format_exception:") print(repr(traceback.format_exception(exc))) print("*** extract_tb:") print(repr(traceback... | trusted_official_docs | CPython Docs | traceback.print_exc(limit=2, file=sys.stdout) print("*** format_exc, first and last line:") formatted_lines = traceback.format_exc().splitlines() print(formatted_lines[0]) print(formatted_lines[-1]) print("*** format_exception:") print(repr(traceback.format_exception(exc))) print("*** extract_tb:") print(repr(traceback... | traceback.print_exc(limit=2, file=sys.stdout) print("*** format_exc, first and last line:") formatted_lines = traceback.format_exc().splitlines() print(formatted_lines[0]) print(formatted_lines[-1]) print("*** format_exception:") print(repr(traceback.format_exception(exc))) print("*** extract_tb:") print(repr(traceback... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d6f9f6eb-e11e-4170-9daf-2bc8ac906e5b | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,087 | supabase-export-v2 | 4ff3068a655db3dd | * Module-level functions offering basic functionality, which are useful for interactive inspection of exceptions and tracebacks.
* :class:`TracebackException` class and its helper classes
:class:`StackSummary` and :class:`FrameSummary`. These offer both more
flexibility in the output generated and the ability to stor... | trusted_official_docs | CPython Docs | * Module-level functions offering basic functionality, which are useful for interactive inspection of exceptions and tracebacks.
* :class:`TracebackException` class and its helper classes
:class:`StackSummary` and :class:`FrameSummary`. These offer both more
flexibility in the output generated and the ability to stor... | * Module-level functions offering basic functionality, which are useful for interactive inspection of exceptions and tracebacks.
* :class:`TracebackException` class and its helper classes
:class:`StackSummary` and :class:`FrameSummary`. These offer both more
flexibility in the output generated and the ability to stor... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d7f871f0-a151-4a18-a12c-5426b0c3eb51 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,100 | supabase-export-v2 | 4ebf291a2a3f5d09 | .. index:: single: ^ (caret); marker
* if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate
format, it prints the line where the syntax error occurred with a caret
indicating the approximate position of the error. | trusted_official_docs | CPython Docs | .. index:: single: ^ (caret); marker
* if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate
format, it prints the line where the syntax error occurred with a caret
indicating the approximate position of the error. | .. index:: single: ^ (caret); marker
* if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate
format, it prints the line where the syntax error occurred with a caret
indicating the approximate position of the error. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
de3f52da-fa75-4afc-8334-5fd025fd33f0 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,113 | supabase-export-v2 | 86563447b24c3fa7 | .. function:: extract_tb(tb, limit=None)
Return a :class:`StackSummary` object representing a list of "pre-processed"
stack trace entries extracted from the
:ref:`traceback object <traceback-objects>` *tb*. It is useful
for alternate formatting of stack traces. The optional *limit* argument has
the same meaning as ... | trusted_official_docs | CPython Docs | .. function:: extract_tb(tb, limit=None)
Return a :class:`StackSummary` object representing a list of "pre-processed"
stack trace entries extracted from the
:ref:`traceback object <traceback-objects>` *tb*. It is useful
for alternate formatting of stack traces. The optional *limit* argument has
the same meaning as ... | .. function:: extract_tb(tb, limit=None)
Return a :class:`StackSummary` object representing a list of "pre-processed"
stack trace entries extracted from the
:ref:`traceback object <traceback-objects>` *tb*. It is useful
for alternate formatting of stack traces. The optional *limit* argument has
the same meaning as ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e01eb281-a73b-449a-a16a-8c54707d8193 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,111 | supabase-export-v2 | 5870e1481f4e1f61 | *f* argument can be used to specify an alternate :ref:`stack frame <frame-objects>` to start. The optional *file* argument has the same meaning as for :func:`print_tb`.
.. versionchanged:: 3.5
Added negative *limit* support. | trusted_official_docs | CPython Docs | *f* argument can be used to specify an alternate :ref:`stack frame <frame-objects>` to start. The optional *file* argument has the same meaning as for :func:`print_tb`.
.. versionchanged:: 3.5
Added negative *limit* support. | *f* argument can be used to specify an alternate :ref:`stack frame <frame-objects>` to start. The optional *file* argument has the same meaning as for :func:`print_tb`.
.. versionchanged:: 3.5
Added negative *limit* support. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e1285aaa-9bbd-4681-b096-cafde3d211e3 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,122 | supabase-export-v2 | 650e56a9a04f54ab | contains several lines that (when printed) display detailed information about where the syntax error occurred. Following the message, the list contains the exception's :attr:`notes <BaseException.__notes__>`.
Since Python 3.10, instead of passing *value*, an exception object
can be passed as the first argument. If *va... | trusted_official_docs | CPython Docs | contains several lines that (when printed) display detailed information about where the syntax error occurred. Following the message, the list contains the exception's :attr:`notes <BaseException.__notes__>`.
Since Python 3.10, instead of passing *value*, an exception object
can be passed as the first argument. If *va... | contains several lines that (when printed) display detailed information about where the syntax error occurred. Following the message, the list contains the exception's :attr:`notes <BaseException.__notes__>`.
Since Python 3.10, instead of passing *value*, an exception object
can be passed as the first argument. If *va... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e310ced4-eb3c-424a-92d3-d4f085f9d8de | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,103 | supabase-export-v2 | 847aef77549997ef | chained exceptions (the :attr:`~BaseException.__cause__` or :attr:`~BaseException.__context__` attributes of the exception) will be printed as well, like the interpreter itself does when printing an unhandled exception.
.. versionchanged:: 3.5
The *etype* argument is ignored and inferred from the type of *value*. | trusted_official_docs | CPython Docs | chained exceptions (the :attr:`~BaseException.__cause__` or :attr:`~BaseException.__context__` attributes of the exception) will be printed as well, like the interpreter itself does when printing an unhandled exception.
.. versionchanged:: 3.5
The *etype* argument is ignored and inferred from the type of *value*. | chained exceptions (the :attr:`~BaseException.__cause__` or :attr:`~BaseException.__context__` attributes of the exception) will be printed as well, like the interpreter itself does when printing an unhandled exception.
.. versionchanged:: 3.5
The *etype* argument is ignored and inferred from the type of *value*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e8449888-3197-4fe2-b175-cda19183ccc5 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,097 | supabase-export-v2 | 129a06c834f2ac84 | Print exception information and stack trace entries from :ref:`traceback object <traceback-objects>` *tb* to *file*. This differs from :func:`print_tb` in the following ways:
* if *tb* is not ``None``, it prints a header ``Traceback (most recent
call last):`` | trusted_official_docs | CPython Docs | Print exception information and stack trace entries from :ref:`traceback object <traceback-objects>` *tb* to *file*. This differs from :func:`print_tb` in the following ways:
* if *tb* is not ``None``, it prints a header ``Traceback (most recent
call last):`` | Print exception information and stack trace entries from :ref:`traceback object <traceback-objects>` *tb* to *file*. This differs from :func:`print_tb` in the following ways:
* if *tb* is not ``None``, it prints a header ``Traceback (most recent
call last):`` | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ef712aac-8b0e-4127-8199-56df722f32da | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,262 | supabase-export-v2 | d7d4a54dd3e27fb9 | ' File "eggs.py", line 42, in eggs\n return "bacon"\n'] >>> an_error = IndexError('tuple index out of range') >>> traceback.format_exception_only(an_error) ['IndexError: tuple index out of range\n']
Examples of Using :class:`TracebackException`
--------------------------------------------- | trusted_official_docs | CPython Docs | ' File "eggs.py", line 42, in eggs\n return "bacon"\n'] >>> an_error = IndexError('tuple index out of range') >>> traceback.format_exception_only(an_error) ['IndexError: tuple index out of range\n']
Examples of Using :class:`TracebackException`
--------------------------------------------- | ' File "eggs.py", line 42, in eggs\n return "bacon"\n'] >>> an_error = IndexError('tuple index out of range') >>> traceback.format_exception_only(an_error) ['IndexError: tuple index out of range\n']
Examples of Using :class:`TracebackException`
--------------------------------------------- | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f022ab66-3428-4f43-b748-cc8ba4cec574 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,261 | supabase-export-v2 | c87aeed32ef2a11c | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> import traceback
>>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),
... ('eggs.py', 42, 'eggs', 'return "bacon"')])
[' File "spam.py", line 3, in <module>\n spam.eggs()\n',
' File "eggs.py", line 42, in eggs\n return "bacon"\n']
>>> an_error = Ind... | trusted_official_docs | CPython Docs | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> import traceback
>>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),
... ('eggs.py', 42, 'eggs', 'return "bacon"')])
[' File "spam.py", line 3, in <module>\n spam.eggs()\n',
' File "eggs.py", line 42, in eggs\n return "bacon"\n']
>>> an_error = Ind... | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> import traceback
>>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),
... ('eggs.py', 42, 'eggs', 'return "bacon"')])
[' File "spam.py", line 3, in <module>\n spam.eggs()\n',
' File "eggs.py", line 42, in eggs\n return "bacon"\n']
>>> an_error = Ind... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f89d0431-3cda-4e44-a07b-bc212a99b5fe | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,153 | supabase-export-v2 | d1403f6311f6a4bf | Note that when locals are captured, they are also shown in the traceback.
*max_group_width* and *max_group_depth* control the formatting of exception
groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting
level of the group, and the width refers to the size of a single exception
group's exceptions a... | trusted_official_docs | CPython Docs | Note that when locals are captured, they are also shown in the traceback.
*max_group_width* and *max_group_depth* control the formatting of exception
groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting
level of the group, and the width refers to the size of a single exception
group's exceptions a... | Note that when locals are captured, they are also shown in the traceback.
*max_group_width* and *max_group_depth* control the formatting of exception
groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting
level of the group, and the width refers to the size of a single exception
group's exceptions a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb3ae33c-0c7a-4ec2-a16c-6bf05ac9827a | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,211 | supabase-export-v2 | 7ce4b3380e9dec31 | may be valuable if it may not actually get formatted). If *capture_locals* is ``True`` the local variables in each :class:`!FrameSummary` are captured as object representations.
.. versionchanged:: 3.12
Exceptions raised from :func:`repr` on a local variable (when
*capture_locals* is ``True``) are no longer propagate... | trusted_official_docs | CPython Docs | may be valuable if it may not actually get formatted). If *capture_locals* is ``True`` the local variables in each :class:`!FrameSummary` are captured as object representations.
.. versionchanged:: 3.12
Exceptions raised from :func:`repr` on a local variable (when
*capture_locals* is ``True``) are no longer propagate... | may be valuable if it may not actually get formatted). If *capture_locals* is ``True`` the local variables in each :class:`!FrameSummary` are captured as object representations.
.. versionchanged:: 3.12
Exceptions raised from :func:`repr` on a local variable (when
*capture_locals* is ``True``) are no longer propagate... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fe9dc63a-82c2-48bf-999f-4e4edf201470 | CPython Docs | file://datasets/cpython/Doc/library/traceback.rst | unknown | 1b68c7e7-268b-43ca-89c4-3fb2e26cc4a4 | 40,117 | supabase-export-v2 | dc63a13b5d0f61d2 | .. function:: print_list(extracted_list, file=None)
Print the list of tuples as returned by :func:`extract_tb` or
:func:`extract_stack` as a formatted stack trace to the given file. If *file* is ``None``, the output is written to :data:`sys.stderr`. | trusted_official_docs | CPython Docs | .. function:: print_list(extracted_list, file=None)
Print the list of tuples as returned by :func:`extract_tb` or
:func:`extract_stack` as a formatted stack trace to the given file. If *file* is ``None``, the output is written to :data:`sys.stderr`. | .. function:: print_list(extracted_list, file=None)
Print the list of tuples as returned by :func:`extract_tb` or
:func:`extract_stack` as a formatted stack trace to the given file. If *file* is ``None``, the output is written to :data:`sys.stderr`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2a6e62ff-3ce3-430b-988f-82df4aa681cf | CPython Docs | file://datasets/cpython/Doc/library/asyncio-api-index.rst | unknown | c1352735-8826-4484-a76d-8c05f150ae48 | 40,279 | supabase-export-v2 | 80f0b6743c44d7b3 | A context manager that holds a group of tasks. Provides a convenient and reliable way to wait for all tasks in the group to finish.
* - :func:`create_task`
- Start an asyncio Task, then returns it. | trusted_official_docs | CPython Docs | A context manager that holds a group of tasks. Provides a convenient and reliable way to wait for all tasks in the group to finish.
* - :func:`create_task`
- Start an asyncio Task, then returns it. | A context manager that holds a group of tasks. Provides a convenient and reliable way to wait for all tasks in the group to finish.
* - :func:`create_task`
- Start an asyncio Task, then returns it. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4d555a87-38d7-4e3f-a190-3daedd4c2347 | CPython Docs | file://datasets/cpython/Doc/library/asyncio-api-index.rst | unknown | c1352735-8826-4484-a76d-8c05f150ae48 | 40,278 | supabase-export-v2 | 237c4fd73e7d4abc | * - :class:`Task` - Task object.
* - :class:`TaskGroup`
- A context manager that holds a group of tasks. Provides
a convenient and reliable way to wait for all tasks in the group to
finish. | trusted_official_docs | CPython Docs | * - :class:`Task` - Task object.
* - :class:`TaskGroup`
- A context manager that holds a group of tasks. Provides
a convenient and reliable way to wait for all tasks in the group to
finish. | * - :class:`Task` - Task object.
* - :class:`TaskGroup`
- A context manager that holds a group of tasks. Provides
a convenient and reliable way to wait for all tasks in the group to
finish. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
01b7ecb8-4a46-458c-9940-a6cc6de90322 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,452 | supabase-export-v2 | cab96d286391475d | These operations also compare elements, so the same :meth:`~object.__eq__` considerations as above apply.
The :meth:`~set.copy` method returns a new object and holds the per-object lock
for the duration so that it is always atomic. | trusted_official_docs | CPython Docs | These operations also compare elements, so the same :meth:`~object.__eq__` considerations as above apply.
The :meth:`~set.copy` method returns a new object and holds the per-object lock
for the duration so that it is always atomic. | These operations also compare elements, so the same :meth:`~object.__eq__` considerations as above apply.
The :meth:`~set.copy` method returns a new object and holds the per-object lock
for the duration so that it is always atomic. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0e93c5c0-aede-4406-9fdf-9c11a20c793c | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,432 | supabase-export-v2 | 2a8c5874c1cc9420 | # NOT thread-safe: iteration while modifying for key, value in d.items(): process(key) # another thread may modify d
To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic
operations or handle exceptions: | trusted_official_docs | CPython Docs | # NOT thread-safe: iteration while modifying for key, value in d.items(): process(key) # another thread may modify d
To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic
operations or handle exceptions: | # NOT thread-safe: iteration while modifying for key, value in d.items(): process(key) # another thread may modify d
To avoid time-of-check to time-of-use (TOCTOU) issues, use atomic
operations or handle exceptions: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
146a1bfb-f0b1-41af-a0fd-1bf3067d36af | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,348 | supabase-export-v2 | f86c317ef3fc2bc7 | build. The guarantees described here apply when using Python with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, most operations are implicitly serialized.
For general guidance on writing thread-safe code in free-threaded Python, see
:ref:`freethreading-python-howto`. | trusted_official_docs | CPython Docs | build. The guarantees described here apply when using Python with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, most operations are implicitly serialized.
For general guidance on writing thread-safe code in free-threaded Python, see
:ref:`freethreading-python-howto`. | build. The guarantees described here apply when using Python with the :term:`GIL` disabled (free-threaded mode). When the GIL is enabled, most operations are implicitly serialized.
For general guidance on writing thread-safe code in free-threaded Python, see
:ref:`freethreading-python-howto`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
14edebab-ac7c-4b04-8fb7-46e7882b4fb3 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,411 | supabase-export-v2 | cacba9e215c6fb2e | .. code-block:: :class: good
d[key] = value # write
del d[key] # delete
d.pop(key) # remove and return
d.popitem() # remove and return last item
d.setdefault(key, v) # insert if missing | trusted_official_docs | CPython Docs | .. code-block:: :class: good
d[key] = value # write
del d[key] # delete
d.pop(key) # remove and return
d.popitem() # remove and return last item
d.setdefault(key, v) # insert if missing | .. code-block:: :class: good
d[key] = value # write
del d[key] # delete
d.pop(key) # remove and return
d.popitem() # remove and return last item
d.setdefault(key, v) # insert if missing | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
197f476c-74e2-436d-84a7-c1fdec96b445 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,469 | supabase-export-v2 | 5e8ec5e9f63b769d | # NOT thread-safe: iteration while modifying for elem in s: process(elem) # another thread may modify s
Consider external synchronization when sharing :class:`set` instances
across threads. See :ref:`freethreading-python-howto` for more information. | trusted_official_docs | CPython Docs | # NOT thread-safe: iteration while modifying for elem in s: process(elem) # another thread may modify s
Consider external synchronization when sharing :class:`set` instances
across threads. See :ref:`freethreading-python-howto` for more information. | # NOT thread-safe: iteration while modifying for elem in s: process(elem) # another thread may modify s
Consider external synchronization when sharing :class:`set` instances
across threads. See :ref:`freethreading-python-howto` for more information. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1dc99890-04cf-4642-8e8a-0d5ce6f7e85c | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,461 | supabase-export-v2 | 20096748e3f6463d | The update variants of the above methods also have some differences between them:
* :meth:`set.difference_update` and :meth:`set.intersection_update` try
to lock all objects one-by-one. * :meth:`set.symmetric_difference_update` only locks the arguments if it is
of type :class:`set`, :class:`frozenset`, or :class:`dic... | trusted_official_docs | CPython Docs | The update variants of the above methods also have some differences between them:
* :meth:`set.difference_update` and :meth:`set.intersection_update` try
to lock all objects one-by-one. * :meth:`set.symmetric_difference_update` only locks the arguments if it is
of type :class:`set`, :class:`frozenset`, or :class:`dic... | The update variants of the above methods also have some differences between them:
* :meth:`set.difference_update` and :meth:`set.intersection_update` try
to lock all objects one-by-one. * :meth:`set.symmetric_difference_update` only locks the arguments if it is
of type :class:`set`, :class:`frozenset`, or :class:`dic... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
209a97e2-abbf-468f-99ed-0e300a39baeb | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,451 | supabase-export-v2 | 53e99b9899126c6f | s.add(elem) # add element s.remove(elem) # remove element, raise if missing s.discard(elem) # remove element if present s.pop() # remove and return arbitrary element
These operations also compare elements, so the same :meth:`~object.__eq__`
considerations as above apply. | trusted_official_docs | CPython Docs | s.add(elem) # add element s.remove(elem) # remove element, raise if missing s.discard(elem) # remove element if present s.pop() # remove and return arbitrary element
These operations also compare elements, so the same :meth:`~object.__eq__`
considerations as above apply. | s.add(elem) # add element s.remove(elem) # remove element, raise if missing s.discard(elem) # remove element if present s.pop() # remove and return arbitrary element
These operations also compare elements, so the same :meth:`~object.__eq__`
considerations as above apply. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
270ce569-560a-48aa-b505-5089f8c442d2 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,382 | supabase-export-v2 | ed10cd11b06e5ec0 | Writing a single item via ``lst[i] = x`` is safe to call from multiple threads and will not corrupt the list.
The following operations return new objects and appear
:term:`atomic <atomic operation>` to other threads: | trusted_official_docs | CPython Docs | Writing a single item via ``lst[i] = x`` is safe to call from multiple threads and will not corrupt the list.
The following operations return new objects and appear
:term:`atomic <atomic operation>` to other threads: | Writing a single item via ``lst[i] = x`` is safe to call from multiple threads and will not corrupt the list.
The following operations return new objects and appear
:term:`atomic <atomic operation>` to other threads: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2b395774-e77d-4be1-9103-ff2771ff9454 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,363 | supabase-export-v2 | 343a93a8462f3094 | threads may call the function at the same time, but they must not pass the same object (or objects that share underlying state) as arguments.
Example: a function that modifies fields of a struct using non-atomic
writes. Two threads can each call the function on their own struct
instance safely, but concurrent calls on ... | trusted_official_docs | CPython Docs | threads may call the function at the same time, but they must not pass the same object (or objects that share underlying state) as arguments.
Example: a function that modifies fields of a struct using non-atomic
writes. Two threads can each call the function on their own struct
instance safely, but concurrent calls on ... | threads may call the function at the same time, but they must not pass the same object (or objects that share underlying state) as arguments.
Example: a function that modifies fields of a struct using non-atomic
writes. Two threads can each call the function on their own struct
instance safely, but concurrent calls on ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f3ca4fa-ed8f-42ae-b996-4193205814ad | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,462 | supabase-export-v2 | 1460489322070d87 | * :meth:`set.difference_update` and :meth:`set.intersection_update` try to lock all objects one-by-one. * :meth:`set.symmetric_difference_update` only locks the arguments if it is of type :class:`set`, :class:`frozenset`, or :class:`dict`.
The following methods always try to lock both objects: | trusted_official_docs | CPython Docs | * :meth:`set.difference_update` and :meth:`set.intersection_update` try to lock all objects one-by-one. * :meth:`set.symmetric_difference_update` only locks the arguments if it is of type :class:`set`, :class:`frozenset`, or :class:`dict`.
The following methods always try to lock both objects: | * :meth:`set.difference_update` and :meth:`set.intersection_update` try to lock all objects one-by-one. * :meth:`set.symmetric_difference_update` only locks the arguments if it is of type :class:`set`, :class:`frozenset`, or :class:`dict`.
The following methods always try to lock both objects: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
31916f20-5160-468d-b3de-07b785234280 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,394 | supabase-export-v2 | 7d17ff5b659beba8 | The :meth:`~list.remove` method may allow concurrent modifications since element comparison may execute arbitrary Python code (via :meth:`~object.__eq__`).
:meth:`~list.extend` is safe to call from multiple threads. However, its
guarantees depend on the iterable passed to it. If it is a :class:`list`, a
:class:`tuple`,... | trusted_official_docs | CPython Docs | The :meth:`~list.remove` method may allow concurrent modifications since element comparison may execute arbitrary Python code (via :meth:`~object.__eq__`).
:meth:`~list.extend` is safe to call from multiple threads. However, its
guarantees depend on the iterable passed to it. If it is a :class:`list`, a
:class:`tuple`,... | The :meth:`~list.remove` method may allow concurrent modifications since element comparison may execute arbitrary Python code (via :meth:`~object.__eq__`).
:meth:`~list.extend` is safe to call from multiple threads. However, its
guarantees depend on the iterable passed to it. If it is a :class:`list`, a
:class:`tuple`,... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
350d84b6-5cc8-483a-b4de-2d263398a845 | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,503 | supabase-export-v2 | 56d98e35734c0587 | Thread safety for memoryview objects ====================================
:class:`memoryview` objects provide access to the internal data of an
underlying object without copying. Thread safety depends on both the
memoryview itself and the underlying buffer exporter. | trusted_official_docs | CPython Docs | Thread safety for memoryview objects ====================================
:class:`memoryview` objects provide access to the internal data of an
underlying object without copying. Thread safety depends on both the
memoryview itself and the underlying buffer exporter. | Thread safety for memoryview objects ====================================
:class:`memoryview` objects provide access to the internal data of an
underlying object without copying. Thread safety depends on both the
memoryview itself and the underlying buffer exporter. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3983c13f-fd5e-4760-919a-f9b11c540e5a | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,426 | supabase-export-v2 | bda33934e638d6f6 | .. code-block:: :class: maybe
d.update(iterable) # iterable is not a dict: only d locked
d |= iterable # iterable is not a dict: only d locked
dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only result locked | trusted_official_docs | CPython Docs | .. code-block:: :class: maybe
d.update(iterable) # iterable is not a dict: only d locked
d |= iterable # iterable is not a dict: only d locked
dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only result locked | .. code-block:: :class: maybe
d.update(iterable) # iterable is not a dict: only d locked
d |= iterable # iterable is not a dict: only d locked
dict.fromkeys(iterable) # iterable is not a dict/set/frozenset: only result locked | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3becc319-97c5-4e75-be31-5d4d96392a3c | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,355 | supabase-export-v2 | bbec5c9d39158f30 | external synchronization. Incompatible code typically accesses global state in an unsynchronized way and must only be called from a single thread throughout the program's lifetime.
Example: a function that modifies process-wide state such as signal handlers
or environment variables, where concurrent calls from any thre... | trusted_official_docs | CPython Docs | external synchronization. Incompatible code typically accesses global state in an unsynchronized way and must only be called from a single thread throughout the program's lifetime.
Example: a function that modifies process-wide state such as signal handlers
or environment variables, where concurrent calls from any thre... | external synchronization. Incompatible code typically accesses global state in an unsynchronized way and must only be called from a single thread throughout the program's lifetime.
Example: a function that modifies process-wide state such as signal handlers
or environment variables, where concurrent calls from any thre... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fd643f2-484f-403f-b71d-0e657c8f9f9b | CPython Docs | file://datasets/cpython/Doc/library/threadsafety.rst | unknown | 7b7dba10-d777-4a50-bdf0-f9e05fe3019b | 40,421 | supabase-export-v2 | 6820df53892b41f2 | All comparison operations also compare values using :meth:`~object.__eq__`, so for non-built-in types the lock may be released during comparison.
:meth:`~dict.fromkeys` locks both the new dictionary and the iterable
when the iterable is exactly a :class:`dict`, :class:`set`, or
:class:`frozenset` (not subclasses): | trusted_official_docs | CPython Docs | All comparison operations also compare values using :meth:`~object.__eq__`, so for non-built-in types the lock may be released during comparison.
:meth:`~dict.fromkeys` locks both the new dictionary and the iterable
when the iterable is exactly a :class:`dict`, :class:`set`, or
:class:`frozenset` (not subclasses): | All comparison operations also compare values using :meth:`~object.__eq__`, so for non-built-in types the lock may be released during comparison.
:meth:`~dict.fromkeys` locks both the new dictionary and the iterable
when the iterable is exactly a :class:`dict`, :class:`set`, or
:class:`frozenset` (not subclasses): | 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.