Newbie: question regarding references and class relationships

Peter Otten __peter__ at web.de
Mon Jun 10 11:05:32 EDT 2013


Rui Maciel wrote:

> How do you guarantee that any object of a class has a specific set of
> attributes?

You don't. 

Such a guarantee is like the third wheel on a bike -- it doesn't improve the 
overall experience.

PS: I'd rather not mention the memory-saving technique that is sometimes 
abused, but here goes: <http://docs.python.org/dev/glossary.html#term-slots>




More information about the Python-list mailing list