CJ
return ExceptionReturn value:
<class 'Exception'>Size: a a a
CJ
return Exception<class 'Exception'>YC
БГ
py3
def get_subclasses(cls):
for chld in cls.__subclasses__():
yield chld
yield from get_subclasses(chld)
for e in get_subclasses(Exception):
print("{}: {}\n".format(e.__name__, e.__doc__))
TypeError: Inappropriate argument type.
StopAsyncIteration: Signal the end from iterator.__anext__().
StopIteration: Signal the end from iterator.__next__().
ImportError: Import can't find module, or can't find name in module.
ModuleNotFoundError: Module not found.
ZipImportError: None
OSError: Base class for I/O related errors.
ConnectionError: Connection error.
BrokenPipeError: Broken pipe.
ConnectionAbortedError: Connection aborted.
ConnectionRefusedError: Connection refused.
ConnectionResetError: Connection reset.
BlockingIOError: I/O operation would block.
ChildProcessError: Child process error.
FileExistsError: File already exists.
FileNotFoundError: File not found.
IsADirectoryError: Operation doesn't work on directories.
NotADirectoryError: Operation only works on directories.
InterruptedError: Interrupted by signal.
PermissionError: Not enough permissions.
ProcessLookupError: Process not found.
TimeoutError: Timeout expired.
UnsupportedOperation: None
ItimerError: None
EOFError: Read beyond end of file.
RuntimeError: Unspecified run-time error.
RecursionError: Recursion limit exceeded.
NotImplementedError: Method or function hasn't been implemented yet.
_DeadlockError: None
NameError: Name not found globally.
UnboundLocalError: Local name referenced but not bound to a value.
AttributeError: Attribute not found.
SyntaxError: Invalid syntax.
IndentationError: Improper indentation.
TabError: Improper mixture of spaces and tabs.
LookupError: Base class for lookup errors.
IndexError: Sequence index out of range.
KeyError: Mapping key not found.
CodecRegistryError: None
ValueError: Inappropriate argument value (of correct type).
UnicodeError: Unicode related error.
UnicodeEncodeError: Unicode encoding error.
UnicodeDecodeError: Unicode decoding error.
UnicodeTranslateError: Unicode translation error.
UnsupportedOperation: None
AssertionError: Assertion failed.
ArithmeticError: Base class for arithmetic errors.
FloatingPointError: Floating point operation failed.
OverflowError: Result too large to be represented.
ZeroDivisionError: Second argument to a division or modulo operation was zero.
SystemError: Internal error in the Python interpreter.
Please report this to the Python maintainer, along with the traceback,
the Python version, and the hardware/OS platform and version.
CodecRegistryError: None
ReferenceError: Weak ref proxy used after referent went away.
BufferError: Buffer error.
MemoryError: Out of memory.
Warning: Base class for warning categories.
UserWarning: Base class for warnings generated by user code.
DeprecationWarning: Base class for warnings about deprecated features.
PendingDeprecationWarning: Base class for warnings about features which will be deprecated
in the future.
SyntaxWarning: Base class for warnings about dubious syntax.
RuntimeWarning: Base class for warnings about dubious runtime behavior.
FutureWarning: Base class for warnings about constructs that will change semantically
in the future.
ImportWarning: Base class for warnings about probable mistakes in module imports
UnicodeWarning: Base class for warnings about Unicode related problems, mostly
related to conversion problems.
BytesWarning: Base class for warnings about bytes and buffer related problems, mostly
related to conversion from str or comparing to str.
ResourceWarning: Base class for warnings about resource usage.
Error: None
Go
return str(Exception)<class 'Exception'>БГ
БГ
БГ
py3
class IncorrectFileError(Exception):
pass
raise IncorrectFileError("File have incorrect format")
Traceback (most recent call last):
File "175105677/source.py", line 4, in <module>
raise IncorrectFileError("File have incorrect format")
__main__.IncorrectFileError: File have incorrect format
Go
YC
YC
БГ
CJ
return str(Exception)<class 'Exception'>CJ
Go
YC
py3
class IncorrectFileError(Exception):
pass
raise IncorrectFileError("File have incorrect format")
Traceback (most recent call last):
File "175105677/source.py", line 4, in <module>
raise IncorrectFileError("File have incorrect format")
__main__.IncorrectFileError: File have incorrect format
БГ
py3
class IncorrectFileError(Exception):
pass
raise IncorrectFileError("File have incorrect format")
Traceback (most recent call last):
File "175105677/source.py", line 4, in <module>
raise IncorrectFileError("File have incorrect format")
__main__.IncorrectFileError: File have incorrect format