(Cc to python dev, as my question is really about 2.x) On 4/13/06, Ian Bicking <[EMAIL PROTECTED]> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com