descriptors
The descriptors module is accessible via the ohm module.
Functions
f simple_repr(func_name, *args, **kw) ...
Helper function for reprs like 'func_name(args, keywords)'
Classes
C cache(...) ...
A caching descriptor wrapper. Takes the attribute name and the wrapped descriptor as arguments.
To expire, use MyClass.cached_attr.expire(my_object) where my_object is an instance of MyClass.
This class contains 5 members.
C converter(...) ...
Applies a FormEncode validator/converter to a descriptor. Supports both a class-level default_validator, and custom validators.
Subclasses (like json_converter) might set default_validator.
This class contains 5 members.
C watcher(...) ...
Calls a callback function with (obj, old_value, new_value) everytime an attribute is set.
You can listen before or after the value is actually set, with before_watcher and after_watcher. delete_watcher (if given) is called with (self, old_value) everytime an attribute is deleted, right before the delete.
This class contains 4 members.
C json_converter(...) ...
Wraps a descriptor and does JSON decoding/encoding.
An underlying string shows up as the JSON it decodes to.
This class contains 5 members.
C line_converter(...) ...
Wraps a descriptor, and splits/joins text lines.
An underlying string shows up as a list of strings split by line.
This class contains 5 members.
See the source for more information.