[Python-Dev] [Python-3000] Removing 'self' from methoddefinitions

Terry Reedy tjreedy at udel.edu
Thu Apr 13 22:55:19 CEST 2006


"Jim Jewett" <jimjjewett at gmail.com> wrote in message 
news:fb6fbf560604131154o1b5ef33fg19d8c01a7e887118 at mail.gmail.com...
> >>> # No syntax errors when creating m()
> >>> class C:
> def m(): pass
>> but the method can't actually be called

Unless it is wrapped as a staticmethod ;-)
...
> >>> C().m()
>> Traceback (most recent call last):
> File "<pyshell#102>", line 1, in -toplevel-
> C().m()
> TypeError: m() takes no arguments (1 given)
>> Could it at least say something like "(1 given, including self)"?

or perhaps '(self + 0 given' or '(instance + 0 more given)'
Terry Jan Reedy


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /