[Python-3000] A better way to initialize PyTypeObject

Ronald Oussoren ronaldoussoren at mac.com
Thu Nov 30 07:19:43 CET 2006


On  30 Nov 2006, at 1:34 AM, Greg Ewing wrote:

> Ronald Oussoren wrote:
>> It is already possibly to extend the  type struct in Python 2.3  
>> and later
>
> From Python?

No, from C.

>
> Python 2.3 (#1, Aug  5 2003, 15:52:30)
> [GCC 3.1 20020420 (prerelease)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> class C(type):
> ...   __slots__ = ['foo']
> ...
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: nonempty __slots__ not supported for subtype of 'type'

<words type="famous,last">
It should be easy enough to add support for this in Python 2.6, all  
required machinery already seems to be present.
</words>

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3562 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20061130/ba65482c/attachment.bin 


More information about the Python-3000 mailing list