Dictless classes
Roy Smith
roy at panix.com
Tue Jul 3 08:28:01 EDT 2012
More information about the Python-list mailing list
Tue Jul 3 08:28:01 EDT 2012
- Previous message (by thread): Dictless classes
- Next message (by thread): Dictless classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <XnsA0856B054AB3Fduncanbooth at 127.0.0.1>, Duncan Booth <duncan.booth at invalid.invalid> wrote: > Also you cannot create a subclass of 'type' with non-empty slots (it throws > a type error "nonempty __slots__ not supported for subtype of 'type'"). > However I don't think that's really relevant as even if they did allow you > to use __slots__ it wouldn't prevent the creation of a __dict__ for the > 'type' base class. I played around a bit trying to write a metaclass which implemented: def __getattribute__(self, name): if name == "__dict__": raise AttributeError but didn't get very far. Maybe somebody with stronger metaclass-fu than I have could run with this idea?
- Previous message (by thread): Dictless classes
- Next message (by thread): Dictless classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list