Package twisted :: Package python :: Module reference :: Class Resolver
[show private | hide private]
[frames | no frames]

Class Resolver


I am can resolve backward named references in a block of code.

Objects created by a block of code that are inserted into a dictionary I store a reference to may later indicate a backreference to one of those objects by creating a 'reference.Reference', specifying the key to be looked up later.

Instantiate me with a lookup table populated with references, then resolve a graph of objects using that table.
Method Summary
  __init__(self, lookup)
Create a resolver.
  res(self, obj)
Traverse a single object's graph and resolve it and its subobjects.
  resdict(self, dict)
Resolve a dictionary; private use
  resinst(self, inst)
Resolve an instance; private use
  reslist(self, lst)
Resolve a list; private use
  resolve(self, reflist)
Resolve a list of references.

Method Details

__init__(self, lookup)
(Constructor)

Create a resolver.
Parameters:
lookup - is an object which responds to the __getitem__ interface and contains all the keys which can be referred to by the References in the 'reflist' argument to my resolve method.

res(self, obj)

Traverse a single object's graph and resolve it and its subobjects.

resdict(self, dict)

Resolve a dictionary; private use

resinst(self, inst)

Resolve an instance; private use

reslist(self, lst)

Resolve a list; private use

resolve(self, reflist)

Resolve a list of references.
Parameters:
reflist - A list of objects which may contain Reference objects, which can be resolved by looking in self.lookup.
           (type=List)

Generated by Epydoc 1.1 on Sat Feb 15 21:19:17 2003 http://epydoc.sf.net