classification
Title: Names in traceback should have class names, if they're methods
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, smurfix
Priority: low Keywords:

Created on 2008-05-07 20:25 by smurfix, last changed 2010-08-07 20:50 by terry.reedy.

Messages (2)
msg66373 - (view) Author: Matthias Urlichs (smurfix) Date: 2008-05-07 20:25
Consider this simple error:

>>> class foo(object):
...   def __init__(self,bar):
...    pass
... 
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() takes exactly 2 positional arguments (1 given)
>>> 

The problem is that if that "foo" call is through a variable (or
anything else that obscures which class I'm actually calling) there's no
good way to figure this from the traceback.

The last line should read

   TypeError: foo.__init__() takes exactly 2 positional arguments (1 given)

or similar.
msg66433 - (view) Author: Alexander Belopolsky (belopolsky) (Python committer) Date: 2008-05-08 19:32
This is similar to issue2516.
History
Date User Action Args
2010-08-07 20:50:42terry.reedysetversions: + Python 3.2, - Python 2.6, Python 3.0
2008-05-11 22:26:55georg.brandlsetpriority: low
type: behavior -> enhancement
components: + Interpreter Core
versions: + Python 2.6, Python 3.0
2008-05-08 19:32:48belopolskysetnosy: + belopolsky
messages: + msg66433
2008-05-07 20:25:57smurfixcreate