> There are two ways to "bind" a built-in function to an object. > > One would be to do what happens for Python functions, which is in > effect a currying: f.__get__(obj) yields a function g that when called > as g(arg1, ...) calls f(obj, arg1, ...). That's the one I'm talking about. I forgot to explain that the problem occurs when I'm creating a *Python* class object and populating it with functions that are supposed to be methods. Currently I have to manually wrap each function in an unbound method object before putting it in the class's __dict__. If that happened automatically on access, I would be able to create Python classes that behave more like the real thing. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
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