descriptors for container items

Brock Filer filerba at softhome.net
Sat Sep 3 18:45:41 EDT 2005


> I personally would first try to dump the quotes and use standard
> attributes --  countries.us.Colorado... -- and the  __get/set/delattr__
> methods.

If I do that, the attributes (that was a stupid name for me to choose) 
and children would have to not share any names with each other, with 
the object's regular attrs, or python keywords.

I toyed with the idea of having __div__ create a descriptor, assign it 
to a temporary attr, and access that. But then I realized that the 
children should never be directly assigned to anyways. I can live with 
one set of brackets at the end of the expression.

__methods__ are delightfully evil :-)




More information about the Python-list mailing list