A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024355.html below:

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib types.py,1.26,1.27

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib types.py,1.26,1.27Martin v. Loewis martin@v.loewis.de
24 May 2002 09:35:03 +0200
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