
Hi! Reading the traceback doc page at https://docs.python.org/3.9/library/traceback.html?highlight=traceback#modul... I found no direct mentions of __traceback__ attribute, which is, afaik, a preferred way of getting exception's traceback info since Python 3.0. Being a newcomer in the subject, it took me some time to find out that using __traceback__ is preferred to sys.exc_info(), which is mentioned right in the beginning of the page. That wouldn't have been necessary, had the proper info been posted on the page. So, I propose to modify at least this intro sentence: "The module uses traceback objects - this is the object type that is stored in the sys.last_traceback<https://docs.python.org/3.9/library/sys.html#sys.last_traceback> variable and returned as the third item from sys.exc_info()<https://docs.python.org/3.9/library/sys.html#sys.exc_info>." And, to make things more clear, make it sound like "The module uses traceback objects - this is the object type that is held in the __traceback__[link: https://docs.python.org/3.9/reference/simple_stmts.html?highlight=__tracebac...] attribute of the exception object (Note: since Python 3.0), stored in the sys.last_traceback<https://docs.python.org/3.9/library/sys.html#sys.last_traceback> variable and returned as the third item from sys.exc_info()<https://docs.python.org/3.9/library/sys.html#sys.exc_info>." -- Regards, Roman Muslinov
participants (1)
-
Муслинов Роман Георгиевич