[Python-Dev] Python 2.3a1's mandatory use of cyclic GC causes existing applications to fail

Kevin Jacobs jacobs@penguin.theopalgroup.com
Thu, 6 Feb 2003 14:31:29 -0500 (EST)


On Thu, 6 Feb 2003, Guido van Rossum wrote:
> Can you suggest a concrete syntax to do this?  Maybe setting __slots__
> to a dictionary mapping names to type specifiers would do it -- and it
> would even be backwards compatible: currently, if __slots__ is a dict,
> its keys are used as slot names and its values are ignored, by virtue
> of the way the type constructor iterates over __slots__.

I already use __slots__ assigned to dictionaries where the values are not
ignored.  They are interpreted by a metaclass to apply type conversion
operators and type/value enforcement predicates to slots.  I hope that
future versions of Python will not tread on this feature.  (Though I'd
happily trade in this feature in exchange for having __slots__ be immutable)

Meta-regards,
-Kevin

-- 
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com