Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Module « traceback » Python 3.13.2

Classe « TracebackException »

Informations générales

Héritage

builtins.object
    TracebackException

Définition

class TracebackException(builtins.object):

help(TracebackException)

An exception ready for rendering.

The traceback module captures enough attributes from the original exception
to this intermediary form to ensure that no references are held, while
still being able to fully print or format it.

max_group_width and max_group_depth control the formatting of exception
groups. The depth refers to the nesting level of the 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.

Use `from_exception` to create TracebackException instances from exception
objects, or the constructor to create TracebackException instances from
individual components.

- :attr:`__cause__` A TracebackException of the original *__cause__*.
- :attr:`__context__` A TracebackException of the original *__context__*.
- :attr:`exceptions` For exception groups - a list of TracebackException
  instances for the nested *exceptions*.  ``None`` for other exceptions.
- :attr:`__suppress_context__` The *__suppress_context__* value from the
  original exception.
- :attr:`stack` A `StackSummary` representing the traceback.
- :attr:`exc_type` (deprecated) The class of the original traceback.
- :attr:`exc_type_str` String display of exc_type
- :attr:`filename` For syntax errors - the filename where the error
  occurred.
- :attr:`lineno` For syntax errors - the linenumber where the error
  occurred.
- :attr:`end_lineno` For syntax errors - the end linenumber where the error
  occurred. Can be `None` if not present.
- :attr:`text` For syntax errors - the text where the error
  occurred.
- :attr:`offset` For syntax errors - the offset into the text where the
  error occurred.
- :attr:`end_offset` For syntax errors - the end offset into the text where
  the error occurred. Can be `None` if not present.
- :attr:`msg` For syntax errors - the compiler error message.

Constructeur(s)

Signature du constructeur Description
__init__(self, exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10, save_exc_type=True, _seen=None)

Liste des propriétés

Nom de la propriétéDescription
exc_type
exc_type_str

Liste des opérateurs

Signature de l'opérateur Description
__eq__(self, other)

Opérateurs hérités de la classe object

__ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__str__(self)
format(self, *, chain=True, _ctx=None, **kwargs) Format the exception. [extrait de format.__doc__]
format_exception_only(self, *, show_group=False, _depth=0, **kwargs) Format the exception part of the traceback. [extrait de format_exception_only.__doc__]
from_exception(exc, *args, **kwargs) Create a TracebackException from an exception. [extrait de from_exception.__doc__]
print(self, *, file=None, chain=True, **kwargs) Print the result of self.format(chain=chain) to 'file'. [extrait de print.__doc__]

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé