chunk_id
large_stringlengths
36
36
doc_type
large_stringclasses
2 values
category
large_stringclasses
17 values
document
large_stringclasses
50 values
version_raw
large_stringclasses
590 values
chunk_index
int64
0
262
text
large_stringlengths
11
5.69k
file_path
large_stringclasses
882 values
f23ceb6b-3912-5d0e-80d1-3bdd14eda814
docs
python
python_datamodel
39
140
: Must return an *asynchronous iterator* object. `object.``__anext__`(*self*)[¶](#object.__anext__ "Permalink to this definition") : Must return an *awaitable* resulting in a next value of the iterator. Should raise a [`StopAsyncIteration`](../library/exceptions.html#StopAsyncIteration "StopAsyncIteration") er...
large_dataset/raw/docs/python/datamodel/datamodel_39.md
ea101c51-737b-5996-a24c-d5efed448552
docs
python
python_datamodel
39
141
asynchronous iterator object. Returning anything else will result in a [`TypeError`](../library/exceptions.html#TypeError "TypeError") error. ### 3.4.4. Asynchronous Context Managers[¶](#asynchronous-context-managers "Permalink to this headline") An *asynchronous context manager* is a *context manager* that is able t...
large_dataset/raw/docs/python/datamodel/datamodel_39.md
d680be44-6796-5d61-865b-d2fb812523cf
docs
python
python_datamodel
39
142
An example of an asynchronous context manager class: ```None class AsyncContextManager: async def __aenter__(self): await log('entering context') async def __aexit__(self, exc_type, exc, tb): await log('exiting context') ``` New in version 3.5. Footnotes [1](#id1) : It *is* possible in so...
large_dataset/raw/docs/python/datamodel/datamodel_39.md
a44ceb9b-a218-506d-8903-1d9ff3834d54
docs
python
python_datamodel
39
143
: “Does not support” here means that the class has no such method, or the method returns `NotImplemented`. Do not set the method to `None` if you want to force fallback to the right operand’s reflected method—that will instead have the opposite effect of explicitly *blocking* such fallback. [4](#id6)...
large_dataset/raw/docs/python/datamodel/datamodel_39.md
6ce5f2c8-b4fd-5bfe-9297-8b64ba5f6385
docs
python
python_exceptions
310
0
# Built-in Exceptions¶ Source: https://docs.python.org/3.10/library/exceptions.html Version: 3.10 In Python, all exceptions must be instances of a class that derives from [`BaseException`](#BaseException "BaseException"). In a [`try`](../reference/compound_stmts.html#try) statement with an [`except`](../reference/com...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
abdb8480-0877-5cd0-b4b3-856d327594be
docs
python
python_exceptions
310
1
class’s constructor. User code can raise built-in exceptions. This can be used to test an exception handler or to report an error condition “just like” the situation in which the interpreter raises the same exception; but beware that there is nothing to prevent user code from raising an inappropriate error. The built...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
0a817135-8300-5413-a2d0-713fad7c680d
docs
python
python_exceptions
310
2
exception. An exception may be handled when an [`except`](../reference/compound_stmts.html#except) or [`finally`](../reference/compound_stmts.html#finally) clause, or a [`with`](../reference/compound_stmts.html#with) statement, is used. This implicit exception context can be supplemented with an explicit cause by usin...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
762aa0a1-9b6e-5fdb-be34-9c4c5ff38d89
docs
python
python_exceptions
310
3
The default traceback display code shows these chained exceptions in addition to the traceback for the exception itself. An explicitly chained exception in `__cause__` is always shown when present. An implicitly chained exception in `__context__` is shown only if `__cause__` is [`None`](constants.html#None "None") and ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
5ba688a7-9132-5117-8571-063192db404c
docs
python
python_exceptions
310
4
[Objects/exceptions.c](https://github.com/python/cpython/tree/3.10/Objects/exceptions.c). Some have custom memory layouts which makes it impossible to create a subclass that inherits from multiple exception types. The memory layout of a type is an implementation detail and might change between Python versions, leading ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
67384dd0-b9df-515c-91d7-c99130292a26
docs
python
python_exceptions
310
5
there were no arguments. `args`[¶](#BaseException.args "Permalink to this definition") : The tuple of arguments given to the exception constructor. Some built-in exceptions (like [`OSError`](#OSError "OSError")) expect a certain number of arguments and assign a special meaning to the elem...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
3d7a1ef6-3bd6-51e6-a540-61750ac9f4ac
docs
python
python_exceptions
310
6
`OtherException`, as would have happened to the traceback of the original `SomeException` had we allowed it to propagate to the caller. ```None try: ... except SomeException: tb = sys.exc_info()[2] raise OtherException(...).with_traceback(tb) ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
cdc7a343-79ad-5142-9e7d-d1e61a96a447
docs
python
python_exceptions
310
7
: Raised when a [buffer](../c-api/buffer.html#bufferobjects) related operation cannot be performed. *exception* `LookupError`[¶](#LookupError "Permalink to this definition") : The base class for the exceptions that are raised when a key or index used on a mapping or sequence is invalid: [`IndexError`](#Ind...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
8d6e055f-0dec-52dc-b0c0-6d17ba27f430
docs
python
python_exceptions
310
8
assignment fails. (When an object does not support attribute references or attribute assignments at all, [`TypeError`](#TypeError "TypeError") is raised.) The `name` and `obj` attributes can be set using keyword-only arguments to the constructor. When set they represent the name of the attribute th...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
a3154d42-fbf0-5a79-beb4-7d703d61ec71
docs
python
python_exceptions
310
9
*exception* `GeneratorExit`[¶](#GeneratorExit "Permalink to this definition") : Raised when a [generator](../glossary.html#term-generator) or [coroutine](../glossary.html#term-coroutine) is closed; see [`generator.close()`](../reference/expressions.html#generator.close "generator.close") and [`coroutine.close()`]...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
54070b45-53ae-5116-b154-a3263fbcda39
docs
python
python_exceptions
310
10
that was attempted to be imported and the path to any file which triggered the exception, respectively. Changed in version 3.3: Added the `name` and `path` attributes. *exception* `ModuleNotFoundError`[¶](#ModuleNotFoundError "Permalink to this definition") : A subclass of [`ImportError`](#ImportError "...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
b96c2885-4ab8-5d8c-a898-3e536db1a511
docs
python
python_exceptions
310
11
*exception* `KeyboardInterrupt`[¶](#KeyboardInterrupt "Permalink to this definition") : Raised when the user hits the interrupt key (normally `Control-C` or `Delete`). During execution, a check for interrupts is made regularly. The exception inherits from [`BaseException`](#BaseException "BaseException") so a...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
7708f7b9-d613-56a2-927b-3f184f92007c
docs
python
python_exceptions
310
12
*exception* `MemoryError`[¶](#MemoryError "Permalink to this definition") : Raised when an operation runs out of memory but the situation may still be rescued (by deleting some objects). The associated value is a string indicating what kind of (internal) operation ran out of memory. Note that because of the ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
a65138a0-6a09-58e3-a40b-d830adc8636f
docs
python
python_exceptions
310
13
to be accessed. Changed in version 3.10: Added the `name` attribute. *exception* `NotImplementedError`[¶](#NotImplementedError "Permalink to this definition") : This exception is derived from [`RuntimeError`](#RuntimeError "RuntimeError"). In user defined base classes, abstract methods should raise this...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
a7916295-73e8-5948-ad30-80da77ba51c3
docs
python
python_exceptions
310
14
*exception* `OSError`([*arg*])[¶](#OSError "Permalink to this definition") *exception* `OSError`(*errno*, *strerror*[, *filename*[, *winerror*[, *filename2*]]]) : This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full” (no...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
363ddf6b-d62b-553d-9f71-0bd98bbfda5a
docs
python
python_exceptions
310
15
the final [`errno`](#OSError.errno "OSError.errno") value. This behaviour only occurs when constructing [`OSError`](#OSError "OSError") directly or via an alias, and is not inherited when subclassing. `errno`[¶](#OSError.errno "Permalink to this definition") : A numeric error code from the C vari...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
8db28066-5a30-5a23-a0ed-f8667270e312
docs
python
python_exceptions
310
16
`strerror`[¶](#OSError.strerror "Permalink to this definition") : The corresponding error message, as provided by the operating system. It is formatted by the C functions `perror()` under POSIX, and `FormatMessage()` under Windows. `filename`[¶](#OSError.filename "Permalink to thi...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
aae2754c-8869-5878-9c59-36955ea0a1dc
docs
python
python_exceptions
310
17
Changed in version 3.3: [`EnvironmentError`](#EnvironmentError "EnvironmentError"), [`IOError`](#IOError "IOError"), [`WindowsError`](#WindowsError "WindowsError"), [`socket.error`](socket.html#socket.error "socket.error"), [`select.error`](select.html#select.error "select.error") and `mmap.error` have been...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
2ca29b7f-623b-5e4b-8a46-ce241480e5a4
docs
python
python_exceptions
310
18
[`MemoryError`](#MemoryError "MemoryError") than give up). However, for historical reasons, OverflowError is sometimes raised for integers that are outside a required range. Because of the lack of standardization of floating point exception handling in C, most floating point operations are not checked. ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
8c6046a3-2ade-579d-acef-fde4c4075fbe
docs
python
python_exceptions
310
19
[`weakref.proxy()`](weakref.html#weakref.proxy "weakref.proxy") function, is used to access an attribute of the referent after it has been garbage collected. For more information on weak references, see the [`weakref`](weakref.html#module-weakref "weakref: Support for weak references and weak dictionaries."...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
93133e92-2f39-55b1-b66f-3f96c12a72d3
docs
python
python_exceptions
310
20
given as an argument when constructing the exception, and defaults to [`None`](constants.html#None "None"). When a [generator](../glossary.html#term-generator) or [coroutine](../glossary.html#term-coroutine) function returns, a new [`StopIteration`](#StopIteration "StopIteration") instance is raise...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
dfbe1c39-ffaf-5844-9264-6c115cdf80bf
docs
python
python_exceptions
310
21
Changed in version 3.7: Enable [**PEP 479**](https://www.python.org/dev/peps/pep-0479) for all code by default: a [`StopIteration`](#StopIteration "StopIteration") error raised in a generator is transformed into a [`RuntimeError`](#RuntimeError "RuntimeError"). *exception* `StopAsyncIteration`[¶](#StopAsyncIte...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
79db5d1d-7c47-5c80-98c4-f4567278fce0
docs
python
python_exceptions
310
22
(also interactively). The [`str()`](stdtypes.html#str "str") of the exception instance returns only the error message. Details is a tuple whose members are also available as separate attributes. `filename`[¶](#SyntaxError.filename "Permalink to this definition") : The name of the file the syntax...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
3b587e0f-3db1-548a-8778-74b5c70352c1
docs
python
python_exceptions
310
23
1-indexed: the first line in the file has a `lineno` of 1. `end_offset`[¶](#SyntaxError.end_offset "Permalink to this definition") : The column in the end line where the error occurred finishes. This is 1-indexed: the first character in the line has an `offset` of 1. For errors in f-stri...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
0eaae0c6-7c38-5234-9482-ff19249503e4
docs
python
python_exceptions
310
24
*exception* `TabError`[¶](#TabError "Permalink to this definition") : Raised when indentation contains an inconsistent use of tabs and spaces. This is a subclass of [`IndentationError`](#IndentationError "IndentationError"). *exception* `SystemError`[¶](#SystemError "Permalink to this definition") : Raised whe...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
980357a2-d22e-5c76-b949-72b2e201dae9
docs
python
python_exceptions
310
25
: This exception is raised by the [`sys.exit()`](sys.html#sys.exit "sys.exit") function. It inherits from [`BaseException`](#BaseException "BaseException") instead of [`Exception`](#Exception "Exception") so that it is not accidentally caught by code that catches [`Exception`](#Exception "Exception"). This al...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
966ab3dc-fec0-5f87-8498-29d9136fe529
docs
python
python_exceptions
310
26
handlers ([`finally`](../reference/compound_stmts.html#finally) clauses of [`try`](../reference/compound_stmts.html#try) statements) can be executed, and so that a debugger can execute a script without running the risk of losing control. The [`os._exit()`](os.html#os._exit "os._exit") function can be used i...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
9e82c543-0c8d-5a1e-a0ee-24efe82785d5
docs
python
python_exceptions
310
27
operation on an object is not supported, and is not meant to be. If an object is meant to support a given operation but has not yet provided an implementation, [`NotImplementedError`](#NotImplementedError "NotImplementedError") is the proper exception to raise. Passing arguments of the wrong type (e.g....
large_dataset/raw/docs/python/exceptions/exceptions_310.md
a95d3f56-215d-53fc-a1b2-a777fccc361c
docs
python
python_exceptions
310
28
: Raised when a Unicode-related encoding or decoding error occurs. It is a subclass of [`ValueError`](#ValueError "ValueError"). [`UnicodeError`](#UnicodeError "UnicodeError") has attributes that describe the encoding or decoding error. For example, `err.object[err.start:err.end]` gives the particular ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
8e0cea5c-8bc5-5a58-aa32-83f10f28426f
docs
python
python_exceptions
310
29
: The index after the last invalid data in [`object`](functions.html#object "object"). *exception* `UnicodeEncodeError`[¶](#UnicodeEncodeError "Permalink to this definition") : Raised when a Unicode-related error occurs during encoding. It is a subclass of [`UnicodeError`](#UnicodeError "UnicodeError"). *...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
99b9320b-7151-5059-8ac6-9f2059d135d6
docs
python
python_exceptions
310
30
more precise exception such as [`IndexError`](#IndexError "IndexError"). *exception* `ZeroDivisionError`[¶](#ZeroDivisionError "Permalink to this definition") : Raised when the second argument of a division or modulo operation is zero. The associated value is a string indicating the type of the operands and ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
c16774d5-5853-5d7b-ad4a-8f68949b4709
docs
python
python_exceptions
310
31
*exception* `BlockingIOError`[¶](#BlockingIOError "Permalink to this definition") : Raised when an operation would block on an object (e.g. socket) set for non-blocking operation. Corresponds to `errno` [`EAGAIN`](errno.html#errno.EAGAIN "errno.EAGAIN"), [`EALREADY`](errno.html#errno.EALREADY "errno.EALREADY"...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
3a5af072-2d39-5702-b76b-4fff8f3a0a68
docs
python
python_exceptions
310
32
*exception* `ChildProcessError`[¶](#ChildProcessError "Permalink to this definition") : Raised when an operation on a child process failed. Corresponds to `errno` [`ECHILD`](errno.html#errno.ECHILD "errno.ECHILD"). *exception* `ConnectionError`[¶](#ConnectionError "Permalink to this definition") : A base class...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
b0d13b32-c6f1-5777-9e42-38bdb4047dcf
docs
python
python_exceptions
310
33
Corresponds to `errno` [`EPIPE`](errno.html#errno.EPIPE "errno.EPIPE") and [`ESHUTDOWN`](errno.html#errno.ESHUTDOWN "errno.ESHUTDOWN"). *exception* `ConnectionAbortedError`[¶](#ConnectionAbortedError "Permalink to this definition") : A subclass of [`ConnectionError`](#ConnectionError "ConnectionError"), raised w...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
f4c856a2-0309-54f3-8473-9190492b2f0a
docs
python
python_exceptions
310
34
Corresponds to `errno` [`ECONNRESET`](errno.html#errno.ECONNRESET "errno.ECONNRESET"). *exception* `FileExistsError`[¶](#FileExistsError "Permalink to this definition") : Raised when trying to create a file or directory which already exists. Corresponds to `errno` [`EEXIST`](errno.html#errno.EEXIST "errno.EE...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
130ea7e6-661f-503b-91ab-e09b865bd92f
docs
python
python_exceptions
310
35
for the rationale), instead of raising [`InterruptedError`](#InterruptedError "InterruptedError"). *exception* `IsADirectoryError`[¶](#IsADirectoryError "Permalink to this definition") : Raised when a file operation (such as [`os.remove()`](os.html#os.remove "os.remove")) is requested on a directory. Cor...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
f38382ee-579e-5c6e-bbae-ecd1d923ab35
docs
python
python_exceptions
310
36
rights - for example filesystem permissions. Corresponds to `errno` [`EACCES`](errno.html#errno.EACCES "errno.EACCES") and [`EPERM`](errno.html#errno.EPERM "errno.EPERM"). *exception* `ProcessLookupError`[¶](#ProcessLookupError "Permalink to this definition") : Raised when a given process doesn’t exist. ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
93ee9410-74e9-54ef-af5e-3cf180ed77a1
docs
python
python_exceptions
310
37
## Warnings[¶](#warnings "Permalink to this headline") The following exceptions are used as warning categories; see the [Warning Categories](warnings.html#warning-categories) documentation for more details. *exception* `Warning`[¶](#Warning "Permalink to this definition") : Base class for warning categories. *exce...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
5fc053fa-843d-5ea1-af61-cc7e9e9183c9
docs
python
python_exceptions
310
38
*exception* `PendingDeprecationWarning`[¶](#PendingDeprecationWarning "Permalink to this definition") : Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment. This class is rarely used as emitting a warning about a poss...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
fd379205-3a90-5e61-8567-daf113866a06
docs
python
python_exceptions
310
39
*exception* `FutureWarning`[¶](#FutureWarning "Permalink to this definition") : Base class for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python. *exception* `ImportWarning`[¶](#ImportWarning "Permalink to this definition") : Base class...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
5d5a7ac3-62c4-5c4b-af10-af6152d81abb
docs
python
python_exceptions
310
40
: Base class for warnings related to [`bytes`](stdtypes.html#bytes "bytes") and [`bytearray`](stdtypes.html#bytearray "bytearray"). *exception* `ResourceWarning`[¶](#ResourceWarning "Permalink to this definition") : Base class for warnings related to resource usage. Ignored by the default warning filters. Ena...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
4b992f9b-e4aa-538f-be4a-44219c9dd0aa
docs
python
python_exceptions
310
41
| +-- KeyError +-- MemoryError +-- NameError | +-- UnboundLocalError +-- OSError | +-- BlockingIOError | +-- ChildProcessError | +-- ConnectionError | | +-- BrokenPipeError | | +-- ConnectionAbortedError | | +-- Connectio...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
74626c01-8a9b-575e-b551-8ef26b4d6e5f
docs
python
python_exceptions
310
42
| +-- UnicodeTranslateError +-- Warning +-- DeprecationWarning +-- PendingDeprecationWarning +-- RuntimeWarning +-- SyntaxWarning +-- UserWarning +-- FutureWarning +-- ImportWarning +-- UnicodeWarning ...
large_dataset/raw/docs/python/exceptions/exceptions_310.md
770f87de-ebb5-5305-9bed-3ecbb2923778
docs
python
python_exceptions
311
0
# Built-in Exceptions¶ Source: https://docs.python.org/3.11/library/exceptions.html Version: 3.11 In Python, all exceptions must be instances of a class that derives from [`BaseException`](#BaseException "BaseException"). In a [`try`](../reference/compound_stmts.html#try) statement with an [`except`](../reference/com...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
cd14bbd1-dc6b-5f9e-a1d5-3dc45cb1971b
docs
python
python_exceptions
311
1
class’s constructor. User code can raise built-in exceptions. This can be used to test an exception handler or to report an error condition “just like” the situation in which the interpreter raises the same exception; but beware that there is nothing to prevent user code from raising an inappropriate error. The built...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
9a29eedc-8361-5048-b76d-01074519fca1
docs
python
python_exceptions
311
2
BaseException.\_\_cause\_\_[¶](#BaseException.__cause__ "Link to this definition") BaseException.\_\_suppress\_context\_\_[¶](#BaseException.__suppress_context__ "Link to this definition") : When raising a new exception while another exception is already being handled, the new exception’s `__context__` attri...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
9001005b-d675-557f-9d6a-a6c4352b1082
docs
python
python_exceptions
311
3
`__cause__` also implicitly sets the `__suppress_context__` attribute to `True`, so that using `raise new_exc from None` effectively replaces the old exception with the new one for display purposes (e.g. converting [`KeyError`](#KeyError "KeyError") to [`AttributeError`](#AttributeError "AttributeError"...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
4fbfa646-2b77-50e7-9728-0397c320b760
docs
python
python_exceptions
311
4
## Inheriting from built-in exceptions[¶](#inheriting-from-built-in-exceptions "Link to this heading") User code can create subclasses that inherit from an exception type. It’s recommended to only subclass one exception type at a time to avoid any possible conflicts between how the bases handle the `args` attribute, a...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
30c2460b-335f-5b34-8c9d-3269db8a7f5c
docs
python
python_exceptions
311
5
## Base classes[¶](#base-classes "Link to this heading") The following exceptions are used mostly as base classes for other exceptions. *exception* BaseException[¶](#BaseException "Link to this definition") : The base class for all built-in exceptions. It is not meant to be directly inherited by user-defined cl...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
8bc188c8-c10a-5b97-9e1d-ac864301b515
docs
python
python_exceptions
311
6
with\_traceback(*tb*)[¶](#BaseException.with_traceback "Link to this definition") : This method sets *tb* as the new traceback for the exception and returns the exception object. It was more commonly used before the exception chaining features of [**PEP 3134**](https://peps.python.org/pep-3134...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
8d3927b6-b330-5315-b99c-12ad420a85e1
docs
python
python_exceptions
311
7
: A writable field that holds the [traceback object](../reference/datamodel.html#traceback-objects) associated with this exception. See also: [The raise statement](../reference/simple_stmts.html#raise). add\_note(*note*)[¶](#BaseException.add_note "Link to this definition") : Add the st...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
79a0d285-1722-5fc8-8458-f556da69c0f5
docs
python
python_exceptions
311
8
: All built-in, non-system-exiting exceptions are derived from this class. All user-defined exceptions should also be derived from this class. *exception* ArithmeticError[¶](#ArithmeticError "Link to this definition") : The base class for those built-in exceptions that are raised for various arithmetic err...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
44b310d7-e372-5d7b-b9c4-15abd08c2958
docs
python
python_exceptions
311
9
can be raised directly by [`codecs.lookup()`](codecs.html#codecs.lookup "codecs.lookup"). ## Concrete exceptions[¶](#concrete-exceptions "Link to this heading") The following exceptions are the exceptions that are usually raised. *exception* AssertionError[¶](#AssertionError "Link to this definition") : Raised...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
74663588-5f0a-5afb-ad6b-c7ed9ec1ffda
docs
python
python_exceptions
311
10
Changed in version 3.10: Added the `name` and `obj` attributes. *exception* EOFError[¶](#EOFError "Link to this definition") : Raised when the [`input()`](functions.html#input "input") function hits an end-of-file condition (EOF) without reading any data. (N.B.: the `io.IOBase.read()` and [`io.IOBase.rea...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
d0017da6-5bb1-51ed-8e82-28ecd0eac8e8
docs
python
python_exceptions
311
11
directly inherits from [`BaseException`](#BaseException "BaseException") instead of [`Exception`](#Exception "Exception") since it is technically not an error. *exception* ImportError[¶](#ImportError "Link to this definition") : Raised when the [`import`](../reference/simple_stmts.html#import) statement has ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
7855dd51-42bb-5c3f-a06c-d0ec30dcca68
docs
python
python_exceptions
311
12
: A subclass of [`ImportError`](#ImportError "ImportError") which is raised by [`import`](../reference/simple_stmts.html#import) when a module could not be located. It is also raised when `None` is found in [`sys.modules`](sys.html#sys.modules "sys.modules"). New in version 3.6. *exception* IndexError[¶...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
88a222c3-bb01-5be2-a44b-fcd44fc4cc08
docs
python
python_exceptions
311
13
regularly. The exception inherits from [`BaseException`](#BaseException "BaseException") so as to not be accidentally caught by code that catches [`Exception`](#Exception "Exception") and thus prevent the interpreter from exiting. Note Catching a [`KeyboardInterrupt`](#KeyboardInterrupt "KeyboardI...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
1295ae50-347d-511b-8d22-cf1ce866b986
docs
python
python_exceptions
311
14
what kind of (internal) operation ran out of memory. Note that because of the underlying memory management architecture (C’s `malloc()` function), the interpreter may not always be able to completely recover from this situation; it nevertheless raises an exception so that a stack traceback can be printe...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
76dee10b-5744-51c9-bf8a-682cdc4d92e9
docs
python
python_exceptions
311
15
: This exception is derived from [`RuntimeError`](#RuntimeError "RuntimeError"). In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs t...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
d49625fa-63e2-585c-bbbb-58a442ab405f
docs
python
python_exceptions
311
16
: This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full” (not for illegal argument types or other incidental errors). The second form of the constructor sets the corresponding attributes, described below. The attr...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
8c065db8-f444-5bc2-8a3c-941d41c58dec
docs
python
python_exceptions
311
17
errno[¶](#OSError.errno "Link to this definition") : A numeric error code from the C variable `errno`. winerror[¶](#OSError.winerror "Link to this definition") : Under Windows, this gives you the native Windows error code. The [`errno`](#OSError.errno "OSError.errno") attribute is then an a...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
61cd9094-6c4c-58d0-b1a8-98e33b468203
docs
python
python_exceptions
311
18
under Windows. filename[¶](#OSError.filename "Link to this definition") filename2[¶](#OSError.filename2 "Link to this definition") : For exceptions that involve a file system path (such as [`open()`](functions.html#open "open") or [`os.unlink()`](os.html#os.unlink "os.unlink")), [`filena...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
cc3a11bf-e9e8-595e-8615-ac7663fa5be1
docs
python
python_exceptions
311
19
constructor may return a subclass. Changed in version 3.4: The [`filename`](#OSError.filename "OSError.filename") attribute is now the original file name passed to the function, instead of the name encoded to or decoded from the [filesystem encoding and error handler](../glossary.html#term-filesystem-e...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
7f943ec7-42a1-535e-9df0-d5ff5ec62838
docs
python
python_exceptions
311
20
*exception* RecursionError[¶](#RecursionError "Link to this definition") : This exception is derived from [`RuntimeError`](#RuntimeError "RuntimeError"). It is raised when the interpreter detects that the maximum recursion depth (see [`sys.getrecursionlimit()`](sys.html#sys.getrecursionlimit "sys.getrecursion...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
0361cdb8-f7a8-5016-8e65-a6dd04d7084e
docs
python
python_exceptions
311
21
: Raised when an error is detected that doesn’t fall in any of the other categories. The associated value is a string indicating what precisely went wrong. *exception* StopIteration[¶](#StopIteration "Link to this definition") : Raised by built-in function [`next()`](functions.html#next "next") and an [ite...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
559389e1-a89a-5a14-a126-cacadfc28296
docs
python
python_exceptions
311
22
raised, and the value returned by the function is used as the [`value`](#StopIteration.value "StopIteration.value") parameter to the constructor of the exception. If a generator code directly or indirectly raises [`StopIteration`](#StopIteration "StopIteration"), it is converted into a [`RuntimeError`]...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
0e51fcf4-a174-5b9d-ad92-87b44ae92940
docs
python
python_exceptions
311
23
*exception* StopAsyncIteration[¶](#StopAsyncIteration "Link to this definition") : Must be raised by [`__anext__()`](../reference/datamodel.html#object.__anext__ "object.__anext__") method of an [asynchronous iterator](../glossary.html#term-asynchronous-iterator) object to stop the iteration. New in version ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
b514a382-d699-598d-b1d8-a0d2a2b01d0b
docs
python
python_exceptions
311
24
filename[¶](#SyntaxError.filename "Link to this definition") : The name of the file the syntax error occurred in. lineno[¶](#SyntaxError.lineno "Link to this definition") : Which line number in the file the error occurred in. This is 1-indexed: the first line in the file has a `lineno` of 1...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
edaaf004-612b-5cfb-8ec9-9800de05153f
docs
python
python_exceptions
311
25
1-indexed: the first character in the line has an `offset` of 1. For errors in f-string fields, the message is prefixed by “f-string: ” and the offsets are offsets in a text constructed from the replacement expression. For example, compiling f’Bad {a b} field’ results in this args attribute: (‘...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
cee63bee-93f5-5f2a-9c60-56af171b63da
docs
python
python_exceptions
311
26
*exception* SystemError[¶](#SystemError "Link to this definition") : Raised when the interpreter finds an internal error, but the situation does not look so serious to cause it to abandon all hope. The associated value is a string indicating what went wrong (in low-level terms). You should report this to...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
847ee950-d6d2-50c6-a121-123861f9f5f4
docs
python
python_exceptions
311
27
caught by code that catches [`Exception`](#Exception "Exception"). This allows the exception to properly propagate up and cause the interpreter to exit. When it is not handled, the Python interpreter exits; no stack traceback is printed. The constructor accepts the same optional argument passed to [`sys...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
e9a38f16-86a2-5ad1-ab03-77f098665a4c
docs
python
python_exceptions
311
28
of losing control. The [`os._exit()`](os.html#os._exit "os._exit") function can be used if it is absolutely positively necessary to exit immediately (for example, in the child process after a call to [`os.fork()`](os.html#os.fork "os.fork")). code[¶](#SystemExit.code "Link to this definition") : ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
643aed26-0cd6-52fd-a408-628dd84b3d7b
docs
python
python_exceptions
311
29
Passing arguments of the wrong type (e.g. passing a [`list`](stdtypes.html#list "list") when an [`int`](functions.html#int "int") is expected) should result in a [`TypeError`](#TypeError "TypeError"), but passing arguments with the wrong value (e.g. a number outside expected boundaries) should result in...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
cf8bded1-bb5f-57e6-a164-ece7f7d6f576
docs
python
python_exceptions
311
30
error. For example, `err.object[err.start:err.end]` gives the particular invalid input that the codec failed on. encoding[¶](#UnicodeError.encoding "Link to this definition") : The name of the encoding that raised the error. reason[¶](#UnicodeError.reason "Link to this definition") : A str...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
9c18eea5-f67f-5209-8f41-cae21e4df110
docs
python
python_exceptions
311
31
*exception* UnicodeDecodeError[¶](#UnicodeDecodeError "Link to this definition") : Raised when a Unicode-related error occurs during decoding. It is a subclass of [`UnicodeError`](#UnicodeError "UnicodeError"). *exception* UnicodeTranslateError[¶](#UnicodeTranslateError "Link to this definition") : Raised when...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
2a5ff49f-b4af-5aef-9c95-9d65a664c768
docs
python
python_exceptions
311
32
The following exceptions are kept for compatibility with previous versions; starting from Python 3.3, they are aliases of [`OSError`](#OSError "OSError"). *exception* EnvironmentError[¶](#EnvironmentError "Link to this definition") *exception* IOError[¶](#IOError "Link to this definition") *exception* WindowsError[¶...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
10217a6d-6a9e-51ee-aca9-6221289e3bb8
docs
python
python_exceptions
311
33
[`EWOULDBLOCK`](errno.html#errno.EWOULDBLOCK "errno.EWOULDBLOCK") and [`EINPROGRESS`](errno.html#errno.EINPROGRESS "errno.EINPROGRESS"). In addition to those of [`OSError`](#OSError "OSError"), [`BlockingIOError`](#BlockingIOError "BlockingIOError") can have one more attribute: characters\_written[¶](...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
9668fb91-d753-52e1-b5b3-a2ccbcd8caf2
docs
python
python_exceptions
311
34
Subclasses are [`BrokenPipeError`](#BrokenPipeError "BrokenPipeError"), [`ConnectionAbortedError`](#ConnectionAbortedError "ConnectionAbortedError"), [`ConnectionRefusedError`](#ConnectionRefusedError "ConnectionRefusedError") and [`ConnectionResetError`](#ConnectionResetError "ConnectionResetError"). *excepti...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
cc241db9-3741-582c-8ffa-e841cd0e3716
docs
python
python_exceptions
311
35
Corresponds to `errno` [`ECONNABORTED`](errno.html#errno.ECONNABORTED "errno.ECONNABORTED"). *exception* ConnectionRefusedError[¶](#ConnectionRefusedError "Link to this definition") : A subclass of [`ConnectionError`](#ConnectionError "ConnectionError"), raised when a connection attempt is refused by the pee...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
fc66ace9-3dd9-5dac-a3dc-8f67bde6708a
docs
python
python_exceptions
311
36
*exception* FileNotFoundError[¶](#FileNotFoundError "Link to this definition") : Raised when a file or directory is requested but doesn’t exist. Corresponds to `errno` [`ENOENT`](errno.html#errno.ENOENT "errno.ENOENT"). *exception* InterruptedError[¶](#InterruptedError "Link to this definition") : Raised when ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
ed271d0c-1883-52da-b98f-4133f2439abd
docs
python
python_exceptions
311
37
Corresponds to `errno` [`EISDIR`](errno.html#errno.EISDIR "errno.EISDIR"). *exception* NotADirectoryError[¶](#NotADirectoryError "Link to this definition") : Raised when a directory operation (such as [`os.listdir()`](os.html#os.listdir "os.listdir")) is requested on something which is not a directory. On mo...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
18fa19df-48d7-5250-b8ee-1050cd4ec025
docs
python
python_exceptions
311
38
Changed in version 3.11.1: WASI’s [`ENOTCAPABLE`](errno.html#errno.ENOTCAPABLE "errno.ENOTCAPABLE") is now mapped to [`PermissionError`](#PermissionError "PermissionError"). *exception* ProcessLookupError[¶](#ProcessLookupError "Link to this definition") : Raised when a given process doesn’t exist. Corre...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
d82e1fca-c5b6-5bbc-8d97-dba7b1a03cba
docs
python
python_exceptions
311
39
## Warnings[¶](#warnings "Link to this heading") The following exceptions are used as warning categories; see the [Warning Categories](warnings.html#warning-categories) documentation for more details. *exception* Warning[¶](#Warning "Link to this definition") : Base class for warning categories. *exception* UserWa...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
1257bf90-bd6d-5ed4-a5d2-32800d876e68
docs
python
python_exceptions
311
40
*exception* PendingDeprecationWarning[¶](#PendingDeprecationWarning "Link to this definition") : Base class for warnings about features which are obsolete and expected to be deprecated in the future, but are not deprecated at the moment. This class is rarely used as emitting a warning about a possible ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
70eba712-6ae2-5a74-a312-1d46e393d4f1
docs
python
python_exceptions
311
41
*exception* FutureWarning[¶](#FutureWarning "Link to this definition") : Base class for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python. *exception* ImportWarning[¶](#ImportWarning "Link to this definition") : Base class for warnings ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
39ee130c-d53e-53f0-889a-6096744855fa
docs
python
python_exceptions
311
42
: Base class for warnings related to [`bytes`](stdtypes.html#bytes "bytes") and [`bytearray`](stdtypes.html#bytearray "bytearray"). *exception* ResourceWarning[¶](#ResourceWarning "Link to this definition") : Base class for warnings related to resource usage. Ignored by the default warning filters. Enabling t...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
c76d1b27-e5b9-57e2-8479-146d3fe03428
docs
python
python_exceptions
311
43
*exception* BaseExceptionGroup(*msg*, *excs*)[¶](#BaseExceptionGroup "Link to this definition") : Both of these exception types wrap the exceptions in the sequence `excs`. The `msg` parameter must be a string. The difference between the two classes is that [`BaseExceptionGroup`](#BaseExceptionGroup "BaseExcep...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
0c236941-0e3e-5be2-8000-6507f140074c
docs
python
python_exceptions
311
44
rather than a [`BaseExceptionGroup`](#BaseExceptionGroup "BaseExceptionGroup") if all contained exceptions are [`Exception`](#Exception "Exception") instances, so it can be used to make the selection automatic. The [`ExceptionGroup`](#ExceptionGroup "ExceptionGroup") constructor, on the other hand, rais...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
11f53ef1-0bfa-58ed-9411-27af62a1c3a2
docs
python
python_exceptions
311
45
current group that match *condition*, or `None` if the result is empty. The condition can be either a function that accepts an exception and returns true for those that should be in the subgroup, or it can be an exception type or a tuple of exception types, which is used to check for a ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
4fa32c65-0ac9-50ad-bb19-26d641173323
docs
python
python_exceptions
311
46
The condition is checked for all exceptions in the nested exception group, including the top-level and any nested exception groups. If the condition is true for such an exception group, it is included in the result in full. split(*condition*)[¶](#BaseExceptionGroup.split "Link to this defin...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
56634f95-08df-5f9b-a37b-9601d5072800
docs
python
python_exceptions
311
47
subclass needs to override it in order to make [`subgroup()`](#BaseExceptionGroup.subgroup "BaseExceptionGroup.subgroup") and [`split()`](#BaseExceptionGroup.split "BaseExceptionGroup.split") return instances of the subclass rather than [`ExceptionGroup`](#ExceptionGroup "ExceptionGroup"). ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
62cab26d-dd66-5339-83cd-ffd443feef53
docs
python
python_exceptions
311
48
these fields do not need to be updated by [`derive()`](#BaseExceptionGroup.derive "BaseExceptionGroup.derive"). ```None >>> class MyGroup(ExceptionGroup): ... def derive(self, excs): ... return MyGroup(self.message, excs) ... >>> e = MyGroup("eg", [Va...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
cae6d3f9-9553-5a31-8b20-b2ae92562a5d
docs
python
python_exceptions
311
49
>>> rest, rest.__context__, rest.__cause__, rest.__notes__ (MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), ['a note']) >>> exc.__traceback__ is match.__traceback__ is rest.__traceback__ True ``` Note that [`BaseExceptionGroup`](#BaseExceptionGroup "...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
38f34336-25e0-5e5e-8cf5-4fd9f0ee7921
docs
python
python_exceptions
311
50
return Errors(excs, self.exit_code) ``` Like [`ExceptionGroup`](#ExceptionGroup "ExceptionGroup"), any subclass of [`BaseExceptionGroup`](#BaseExceptionGroup "BaseExceptionGroup") which is also a subclass of [`Exception`](#Exception "Exception") can only wrap instances of [`Exception`](#Excep...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
decdf779-c2c4-5410-a222-5d3b74bce979
docs
python
python_exceptions
311
51
├── NameError │ └── UnboundLocalError ├── OSError │ ├── BlockingIOError │ ├── ChildProcessError │ ├── ConnectionError │ │ ├── BrokenPipeError │ │ ├── ConnectionAbortedError │ │ ├── ConnectionRefusedError │ │ └── ConnectionRe...
large_dataset/raw/docs/python/exceptions/exceptions_311.md
5a0ea1cd-3fce-5846-823a-9807fdb093d6
docs
python
python_exceptions
311
52
│ └── UnicodeTranslateError └── Warning ├── BytesWarning ├── DeprecationWarning ├── EncodingWarning ├── FutureWarning ├── ImportWarning ├── PendingDeprecationWarning ├── ResourceWarning ├── RuntimeWarning ...
large_dataset/raw/docs/python/exceptions/exceptions_311.md