Bypassing __getattribute__ for attribute access

Michele Simionato michele.simionato at gmail.com
Sat Oct 27 01:42:38 EDT 2007


On Oct 25, 5:07 pm, Adam Donahue <adam.dona... at gmail.com> wrote:
> As an exercise I'm attempting to write a metaclass that causes an
> exception to be thrown whenever a user tries to access
> 'attributes' (in the traditional sense) via a direct reference.

Well, now thanks to Bruno and the others you know everything about
attribute access in Python. Still, you may be interested in this
recipe, which involves __setattr__ and non __getattribute__:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158

   Michele Simionato




More information about the Python-list mailing list