> A strange thought, but with the advent of type/class unification and the > 'object' base class, is it possible to inject new methods into the 'object' > type at runtime, allowing: > > def len(self): > return self.__length__() > object.len = len No you can't. Built-in types are immutable. Two reasons: they're shared between multiple interpreters, and it would encourage modules to modify a built-in type to suit their own needs, which it might break other modules. --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