[PEAK] The road to PyProtocols 1.0

Ian Bicking ianb at colorstudy.com
Sun May 30 02:26:11 EDT 2004


On May 30, 2004, at 12:43 AM, Phillip J. Eby wrote:
> * Raise 'AdaptationFailure' instead of 'NotImplementedError'.  
> 'AdaptationFailure' should subclass 'NotImplementedError' and 
> 'TypeError'.
>
> * 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 am in FormEncode, but maybe I shouldn't be.  Basically I allow 
objects to either provide an attribute, or an adapter, and lazily I've 
only ended up using attributes -- i.e., the factory gets ob.validator 
instead of actually registering an adapter for ob -> IValidator.  
Frankly I still don't know what I'm doing with interfaces and adapters, 
or how they should really fit into the system, so I've fumbled around 
with different ways of using it.

Also, perhaps you should copy this list to 
python-interfaces at twistedmatrix.com

--
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org




More information about the PEAK mailing list