On 11/22/2010 10:46 AM, Roman Dolgiy wrote:
Hello,

I need to implement such behavior:

obj.attr1.attr2.attr3 -->  obj.attr1__attr2__attr3

obj.attr1.attr2.attr3 is parsed as ((obj.attr1).attr2).attr3,
so this cannot work in general but only if attr1 and attr2 are known to not be 'final' names.

It looks like I have to override obj's class __getattribute__ and also
use python descriptors somehow.

Any help will be much appreciated.
http://stackoverflow.com/questions/4247036/python-recursively-getattribute

The code posted there by THC4k depened on such knowledge, which you gave there but not here.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to