[Python-3000] PEP 3100 Comments
Guido van Rossum
guido at python.org
Wed May 10 21:58:07 CEST 2006
On 5/8/06, Greg Ewing <greg.ewing at canterbury.ac.nz> 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/)
More information about the Python-3000
mailing list