Package aquarium :: Package util :: Module InternalLibrary :: Class _DescendClassHierarchyImpl
[show private | hide private]
[frames | no frames]

Class _DescendClassHierarchyImpl


Implement the inverseExtend method.

There are many ways to implement this method. One involves the use of yield. It doesn't require a callNext parameter, but it is not possible to use such an implementation in a function that has a return statement (which Cheetah methods always do, unfortunately). Another involves the use of a closure. This is elegant, but not viable if you are stuck with an old version of Python. The implementation here is based on a class that has a __call__ method and can thus pretend to be a closure. I may switch back to the closure version of this code once they upgrade the version of Python at work.

Do not use this class directly, rather use aquarium.util.InternalLibrary.inverseExtend.

The following private variables are used:

_obj
This is the instance that the bound method belongs to.
_methods
This will contain the methods from the least senior classes first because it will be treated as a stack in __call__.

Method Summary
  __init__(self, boundMethod)
Build all the necessary data structures.
  __call__(self, *args, **kargs)
This is like super(), but it calls the subclass's method.

Method Details

__init__(self, boundMethod)
(Constructor)

Build all the necessary data structures.

__call__(self, *args, **kargs)
(Call operator)

This is like super(), but it calls the subclass's method.

See aquarium.util.InternalLibrary.inverseExtend. Warning, this is a bound method that acts like a closure.


Generated by Epydoc 2.1 on Mon Jan 1 16:34:19 2007 http://epydoc.sf.net