Home | Trees | Index | Help |
---|
Package twisted :: Package python :: Module reflect :: Class PropertyAccessor |
|
object
--+
|
PropertyAccessor
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 the 2.1 version - 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 Summary | |
---|---|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature (inherited from object )
| |
x.__delattr__('name') <==> del x.name (inherited from object )
| |
x.__getattribute__('name') <==> x.name (inherited from object )
| |
Return hash(x) (inherited from object )
| |
Return a new object with type S, a subtype of T (inherited from type )
| |
helper for pickle (inherited from object )
| |
Return repr(x) (inherited from object )
| |
x.__setattr__('name', value) <==> x.name = value (inherited from object )
| |
Return str(x) (inherited from object )
| |
reallyDel(self,
k)
| |
reallySet(self,
k,
v)
|
Class Variable Summary | |
---|---|
type |
AccessorType
|
Class Variable Details |
---|
AccessorTypeAccessorType = twisted.python.reflect.AccessorType
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.2 prerelease on Wed Jan 29 06:28:38 2003 | http://epydoc.sf.net |