On 5/20/2010 4:02 AM, Floris Bruynooghe wrote: >> TypeError: invoked as a method, echo() takes exactly 1 argument (0 given) >> >> captures the semantics, but is perhaps too verbose. > > How about: > > TypeError: bound method echo() takes exactly 1 argument (0 given) > > That way you can also have: "unbound method echo() ...". And it's as > semantically correct as the short "echo() takes ..." > > Not having looked at the code I don't know how hard it is for the code > that raises this traceback to notice if it's a bound or unbound method > tough. In 3.x, there are no unbound method objects, just functions. But that should make the difference *easier* to detect, as bound/unbound method objects were actually the same class, differing only in an attribute. I notice >>> list.append() Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> list.append() TypeError: descriptor 'append' of 'list' object needs an argument So here the message is specific to the type of the callable.
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