On Thu, May 20, 2010 at 22:54, Steven D'Aprano <steve at pearwood.info> wrote: > This is misleading, since C().method is a bound method which takes one > argument, x, not two. I find myself wishing that Python distinguished > between ArgumentError and other TypeErrors, so that the method wrapper > of bound methods could simply catch ArgumentError and subtract 1 from > each argument count. But how exactly could it distinguish between various levels of call nesting? class C: def a(self, i): return self.b(i) def b(self, j): return self.c(j) def c(self, k): return self.a() What should C.a(), C().a(), and C().a(1) each yield? Does it change if c(self, k) calls C.a(self)? -- Michael Urman
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