[PEAK] Circular class adapters..

Phillip J. Eby pje at telecommunity.com
Thu Feb 19 19:49:02 EST 2004


At 06:39 PM 2/19/04 -0500, Phillip J. Eby wrote:
>At 06:34 PM 2/19/04 -0500, Bob Ippolito wrote:
>>
>>How do I make this work?  Is it not possible, or is this a bug in
>>PyProtocols?  With 0.9.2, I get this nasty traceback:
>
>Ugh.  It looks like advising an object (the object itself, as opposed to 
>its class) with a circular adapter path doesn't work right.  I have no 
>idea why, I'll have to investigate further (and add your example to the tests.

Ugh, ugh, ugh!  It looks like there is a nasty misdesign of the 
'declareProvides()' and 'registerObject()' methods.  'registerObject()' is 
unconditionally recursive with respect to implied protocols.  It should be 
checking a return value from 'declareProvides()', but 'declareProvides()' 
isn't required to even have a return value, nor is one implemented.

Yuck.  This ought to teach me to write the tests *first*, 
dammit.  Although, you'd think I'd have learned by now from the last dozen 
or so bugs...

(Unfortunately, I'll be doing penance for my sins for some time to come, 
since *most* of PEAK was written with the tests second instead of first.)

Anyway, I've checked in a fix now, but I don't plan to make an immediate 
release in case you find any more bugs.  :)  Feel free to download a .tgz 
from either the PEAK or PyProtocols CVS distro in the meantime.




More information about the PEAK mailing list