[Python-3000] metaclass syntax [was: Discussions with no PEPs] (original) (raw)

Jim Jewett jimjjewett at gmail.com
Thu Mar 15 14:45:59 CET 2007


(reasons to use a custom dict, other than ordering)

> (1) immutable class dictionaries. These are typical for > extension classes, but a real pain for python classes.

> (2) almost-immutable -- with callbacks when values are > added/changed/deleted.

> (3) actually-private variables

On 3/9/07, Guido van Rossum <guido at python.org> wrote:

Those look like use cases for metaclasses, but I don't see how they require setting a custom dict *while the class suite is being executed*.

I was thinking too much of attempts to subclass module. The newly created objects retain a reference to the original dictionary as their globals. I should at least have made that assumption clear.

-jJ



More information about the Python-3000 mailing list