subclassing a module: misleading(?) error message

Gabriel Genellina gagsl-py at yahoo.com.ar
Thu Jan 4 22:30:08 EST 2007


At Thursday 4/1/2007 17:49, Erik Johnson wrote:

>Python 2.3.4 (#1, Feb  7 2005, 15:50:45)
>Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "Sub.py", line 4, in ?
>     class Sub(Super):
>TypeError: function takes at most 2 arguments (3 given)
>
>Why does python complain about a function here? (it's a class definition
>statement, right?)
>Is there really a function being called here?
>If so:
>     What function was called?
>     What two arguments is it expecting?
>     What three were given?

The same thing on Python 2.4.2 (at least) prints a much more meaningful error:

Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass bases
     module.__init__() takes at most 2 arguments (3 given)


-- 
Gabriel Genellina
Softlab SRL 


	

	
		
__________________________________________________ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 




More information about the Python-list mailing list