Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Why do we need Traceback Objects?

Skip Montanaroskip@mojam.com (Skip Montanaro)
Thu, 6 Apr 2000 08:08:14 -0500 (CDT)


    Vladimir> This reminds me that some time ago I made an experimental    Vladimir> patch for removing SET_LINENO. There was the problem of    Vladimir> generating callbacks for pdb (which I think I solved somehow    Vladimir> but I don't remember the details). I do remember that I had to    Vladimir> look at pdb again for some reason. Is there any interest in    Vladimir> reviving this idea?I believe you can get line number information from a code object's co_lnotabattribute, though I don't know the format.  I think this should besufficient to allow SET_LINENO to be eliminated altogether.  It's just thatthere are places in various modules that predate the appearance ofco_lnotab.Whoops, wait a minute.  I just tried    >>> def foo(): pass    ...     >>> foo.func_code.co_lnotab with both "python" and "python -O".  co_lnotab is empty for python -O.  Ithought it was supposed to always be generated?-- Skip Montanaro |http://www.mojam.com/skip@mojam.com |http://www.musi-cal.com/


[8]ページ先頭

©2009-2025 Movatter.jp