On 5/8/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > While we're on the subject, something that causes me > intense annoyance from time to time is when I get a > message like "Method foobar expects m args, got n", > but it doesn't tell me *which* of the myriad foobar > methods in my program it was trying to call. > > It would be much more helpful if it could say something > like "Method YourModule.YourClass.foobar ..." > > This might require storing a bit more information > in a function at def time. But it wouldn't be as > difficult as in the earlier discussions about having > a method reference its class, because we don't need > the actual class, just its name.
Would it be okay to list the filename and line no instead of the class? That information is readily available from the code object. (I'm assuming you're talking about Python functions/methods, not C ones -- for those, teh best you can do in general is specify the module; perhaps the class/type is also available if applicable.) I think a patch for this type of improvement would be happily accepted. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com