Documentation on creating new types with slots in C ?

Boris Boutillier boris.boutillier at arteris.net
Fri Oct 17 18:05:06 CEST 2003


That was not clear.
By slots, I mean the equivalent of '__slots__' in pure python,
ie adding some attribute as offsets at the end of the C description of a
Type.
And in fact what I am really looking for is how to describe '__slots__' in the C
description of a Metaclass.

Hope this make it a bit clearer.

Boris


On Fri, 17 Oct 2003 14:58:44 +0000, Alex Martelli wrote:

> Boris Boutillier wrote:
> 
>> Hi all,
>> 
>> Of what I heard Python 2.3 now allow creation of new types in C with
>> slots.
>> Is there somewhere some documentation on this, or at least an example ?
> 
> I'm not sure what you mean by "with slots" in this context.  Creating
> new types is well documented at:
> 
> http://www.python.org/doc/current/api/newTypes.html
> 
> and descriptors, assuming that might be what you mean by 'slots',
> at http://users.rcn.com/python/download/Descriptor.htm (all the
> examples there are in Python, but it should be easy for you to
> translate them into C).
> 
> 
> Alex





More information about the Python-list mailing list