On 8/10/2012 2:52 PM, Chuck wrote:
Hi all, I cannot figure why I keep getting this error.

To supplement Dave's answer (post entire traceback, dedent last two lines), here are the essentials of your code that show the problem.

>>> class C:
        def f(self): pass
        f()
        
Traceback (most recent call last):
  File "<pyshell#17>", line 1, in <module>
    class C:
  File "<pyshell#17>", line 3, in C
    f()
TypeError: f() missing 1 required positional argument: 'self'

You problem is that you are calling the function during the execution of the class statement, *before* the class is created.
Rather unusual ;-).

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to