(Cc to python dev, as my question is really about 2.x) On 4/13/06, Ian Bicking <ianb at colorstudy.com> wrote: > ... the self in the signature (and the miscount of arguments > in TypeError exceptions) ... Even in the 2.x line, the TypeError messages should be improved. >>> # No syntax errors when creating m() >>> class C: def m(): pass but the method can't actually be called, and won't quite say why. >>> # This message is good >>> C.m() Traceback (most recent call last): File "<pyshell#101>", line 1, in -toplevel- C.m() TypeError: unbound method m() must be called with C instance as first argument (got nothing instead) but the obvious fix of using an instance is just confusing >>> 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)"? I suppose the argument might be named something other than self, particularly in C code, but ... that strikes me as a smaller problem than the mysteriously appearing invisible argument. -jJ
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4