Specifying __slots__ in a dynamically generated type

François Pinard pinard at iro.umontreal.ca
Sun Mar 27 18:19:19 EST 2005


[Ron Garret]

> Is it really impossible to specify __slots__ using the "type"
> constructor?

It does not work?  I vaguely remember having needed to do this once or
twice, and it worked immediatly as expected.  Unless I remember wrongly,
you only have to preset `__slots__' in the dict you give to `type'.

-- 
François Pinard   http://pinard.progiciels-bpi.ca



More information about the Python-list mailing list