[PEAK] The road to PyProtocols 1.0

Phillip J. Eby pje at telecommunity.com
Sat Jun 19 16:33:41 EDT 2004


At 01:59 PM 5/30/04 -0400, Bob Ippolito wrote:

>On May 30, 2004, at 1:43 AM, Phillip J. Eby wrote:
>
>>* Check if anybody's using the 'factory' argument to 'adapt()', and if 
>>not, get rid of it.
>>
>>* If 'factory' isn't used anywhere, consider ditching the second 
>>parameter passed to adapters.  That is, instead of calling 
>>'someadapter(ob,proto)', just call 'someadapter(ob)'.  This would give 
>>PyProtocols adapters the same calling signature as e.g. Zope adapters.
>
>I think I've used factory before, but I don't believe I've used the second 
>argument to adapters.  It wouldn't be a big deal if you removed factory, 
>since it can be emulated by defaulting to some token and checking for the 
>token after adaptation.

And, if the same factory is always used for a given protocol, and the 
protocol is a PyProtocols protocol, you can also replace it by declaring 
the factory as an adapter 'forTypes=[object]' to the desired protocol.




More information about the PEAK mailing list