On Mon, Jan 25, 2010 at 06:34:06PM +0100, Sophana K wrote:
> In all cases, it looks like Transaction.__getattr__ gets called at
> places I don't understand.
> I don't understand very well what is the function of the
> Transaction.__getattr__ method.
Transaction.__getattr__ redirects attribute access to the underlying
connection (self._dbConnection); non-method attributes are wrapped into
ConnWrapper instances; method access are wrapped as instancemethod with
fake class - the class is self.__class__ (Transaction), not the class of
the connection (self._dbConnection); the last one is neccessary to
redirect attribute access on self._dbConnection back to the transaction
instance.
Oleg.
--
Oleg Broytman http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|