On Class namespaces, calling methods

Duncan Booth duncan.booth at invalid.invalid
Sat Apr 10 16:46:46 CEST 2010


vsoler <vicente.soler at gmail.com> wrote:

> I get the following error message:
> 
>      TypeError: m() takes no arguments (1 given)
> 
> Since I have not created any instances of Uno, there is no self
> object, and I do not understand what object is supplied to the
> function call.
> 
> Could anybody explain what argument is being supplied to the method?
> Is ther any workaround to call the m function?
> 

Which version of Python are you using? Python 2.6 gives:

TypeError: unbound method m() must be called with Uno instance as first 
argument (got nothing instead)

whereas Python 3.1 gives:

>>> Uno.m()
mouse

(assuming you change the print statement to work on Python 3.x)



More information about the Python-list mailing list