A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/038579.html below:

[Python-Dev] Efficient predicates for the standard library)

More informative error messages (Re: [Python-Dev] Efficient predicates for the standard library) More informative error messages (Re: [Python-Dev] Efficient predicates for the standard library)Guido van Rossum guido at python.org
Tue Oct 7 22:49:07 EDT 2003
> > >   TypeError: MyStuff.SomeClass.foo() takes exactly 1 argument (2
> > >given)
> > 
> > AFAICT, this would at least require a compiler change, and a
> > change to the layout of code objects, so that a code object would
> > know its "dotted name".
> 
> Perhaps. I had the idea that methods already had some notion of
> the name of the class they were defined in, but maybe that's
> only bound methods. In any case, I think it would be worth
> making this change.

Only bound methods.  What should the error message be in this case?

  class C:
    pass

  def f(self, a): pass

  C.f = f

  C().f()

> > Don't tracebacks give line number and file?
> 
> Yes, but the exception occurs just *before* the function is entered,
> so the traceback stops one level short of showing you where the
> function being called is defined! That's what makes this problem
> so annoying.

Yes, that's one of the issues of this.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list

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