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

Guido van Rossum guido@python.org
Thu, 06 Feb 2003 14:46:24 -0500


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)

Hm... Given this feedback, it sounds like the only way to implement Christian's suggestion in a backwards-compatible way would be to use a different xxx name, e.g. fields. I also like the suggestion of allowing control over the order as well.

--Guido van Rossum (home page: http://www.python.org/~guido/)