> > > 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/)
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