Guido van Rossum <guido@python.org> writes: > - The 'new' module may also become deprecated; its functions > (instance, instancemethod, function, code, module, and classobj) > should be implementable by calling the appropriate types (not all of > these are their own factories yet, so that's another task). Then > for compatibility, a module "new.py" may be provided that implements > the interfaces in a backward-compatible way. I think that "new" might be the place where the type objects are exposed; it's not just the matter of making the types callable, but also of exposing their names somewhere. Then, in types.py class _C: def _m(self): pass ClassType = type(_C) UnboundMethodType = type(_C._m) # Same as MethodType _x = _C() InstanceType = type(_x) MethodType = type(_x._m) would become ClassType = new.classobj UnboundMethodType = MethodType = new.instancemethod InstanceType = new.instance Regards, Martin
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