The Python Language Reference, Release 3.9.5 25 3.2. The standard type hierarchy Traceback objects Traceback objects represent a stack trace of an exception. A traceback object is im- plicitly created when an exception occurs, and may also be explicitly created by calling types. $_{TracebackType}$. Slice objects Slice objects are used to represent slices for$_{__getitem__()}$ methods. They are also created by the built-in$_{slice()}$ function. Static method objects Static method objects provide a way of defeating the transformation of function objects to method objects described above. A static method object is a wrapper around any other object, usually a user-defined method object. When a static method object is retrieved from a class or a class instance, the object actually returned is the wrapped object, which is not subject to any further transformation. Static method objects are not themselves callable, although the objects they wrap usually are. Static method objects are created by the built-in$_{staticmethod()}$ constructor. Class method objects A class method object, like a static method object, is a wrapper around another object that alters the way in which that object is retrieved from classes and class instances. The behaviour of class method objects upon such retrieval is described above, under “User-defined methods”. Class method objects are created by the built-in$_{classmethod()}$ constructor. Special read-only attributes: $_{start}$is the lower bound; $_{stop}$is the upper bound; $_{step}$is the step value; each is$_{None}$ if omitted. These attributes can have any type. Slice objects support one method: This method takes a single integer argument length and computes information about the slice that the slice object would describe if applied to a sequence of length items. It returns a tuple of three integers; respectively these are the start and stop indices and the step or stride length of the slice. Missing or out-of-bounds indices are handled in a manner consistent with regular slices. Changed in version 3.7: Traceback objects can now be explicitly instantiated from Python code, and the tb_next attribute of existing instances can be updated. Special writable attribute: tb_next is the next level in the stack trace (towards the frame where the exception occurred), or$_{None}$ if there is no next level. Accessing tb_frame raises an auditing event object.__getattr__ with arguments $_{obj}$and "tb_frame" . Special read-only attributes:$_{tb_frame}$ points to the execution frame of the current level;$_{tb_lineno}$ gives the line number where the exception occurred;$_{tb_lasti}$ indicates the precise instruction. The line number and last instruction in the traceback may differ from the line number of its frame object if the exception occurred in a$_{try}$ statement with no matching except clause or with a finally clause. For explicitly created tracebacks, it is up to the creator of the traceback to determine how the tb_next attributes should be linked to form a full stack trace. When the program contains no suitable handler, the stack trace is written (nicely formatted) to the standard error stream; if the interpreter is interactive, it is also made available to the user as sys. last_traceback . For implicitly created tracebacks, when the search for an exception handler unwinds the execution stack, at each unwound level a traceback object is inserted in front of the current traceback. When an exception handler is entered, the stack trace is made available to the program. (See section The try statement .) It is accessible as the third item of the tuple returned by sys.exc_info() , and as the __traceback__ attribute of the caught exception. New in version 3.4. $_{RuntimeError}$is raised if the frame is currently executing. This method clears all references to local variables held by the frame. Also, if the frame belonged to a generator, the generator is finalized. This helps break reference cycles involving frame objects (for example when catching an exception and storing its traceback for later use). slice. indices ( self , length$_{)}$ frame. clear ()