t.p.r.PropertyAccessor(object) : class documentation

Part of twisted.python.reflect View Source View In Hierarchy

A mixin class for Python 2.2 that uses AccessorType.

This provides compatability with the pre-2.2 Accessor mixin, up to a point.

Extending this class will give you explicit accessor methods; a method called set_foo, for example, is the same as an if statement in __setattr__ looking for 'foo'. Same for get_foo and del_foo.

There are also reallyDel and reallySet methods, so you can override specifics in subclasses without clobbering __setattr__ and __getattr__, or using non-2.1 compatible code.

There is are incompatibilities with Accessor - accessor methods added after class creation will *not* be detected. OTOH, this method is probably way faster.

In addition, class attributes will only be used if no getter was defined, and instance attributes will not override getter methods whereas in original Accessor the class attribute or instance attribute would override the getter method.
Method reallySet Undocumented
Method reallyDel Undocumented
def reallySet(self, k, v): (source)
def reallyDel(self, k): (source)
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:12:41.