Caching and aliasing with descriptors

Category: Python - Education

This script contains a few simple descriptor classes to compute and cache attribute value on demand and to define attribute as alias to other. Date: 27 January, 2012


Caching Descriptors - Aliasing Descriptors - Attribute Value - Attribute - Value - Caching

Homepage: http://code.activestate.com/

Developer: code.activestate.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

This script presents an ideom for simplified accessors, that combines typical getter and setter functionality of an attribute into a single overloaded method, that instead of getATTRIBUTE and setATTRIBUTE can now just be called ATTRIBUTE.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script presents an ideom for simplified accessors, that combines typical getter and setter functionality of an attribute into a single overloaded method, that instead of getATTRIBUTE and setATTRIBUTE can now just be called ATTRIBUTE.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris


This script defines a dictionary with attribute-style access.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Python has no inherent provision for a restrictive API that blocks accesses to methods and variables outside an allowed set.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script presents a way to introduce proper attribute access protection levels using a generic proxy object.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Whenever a superclass implements a __init__ method to initialize its attributes, subclasses derived from it have to invoke the __init__ method of the superclass.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script uses the 'Multicast' class to multiplex messages/attribute requests to objects which share the same interface.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script demonstrates a C -like template based inheritance implementation in Python.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script can be good to avoid some limitations of multiple inheritance, when in need to expand functionalities of superclasses in the hierarchy or controlling the classes cooperation.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All