On Thu, Nov 16, 2006 at 10:21:09AM +0100, Philipp von Weitershausen wrote:
> >How would I _really_ return None from an adapter?
> 
> You don't. You call the adaption with a default value (e.g. None) to 
> cover for the "coudln't adapt" case:
> 
>   >>> getAdapter('moo', DateTime, None)

That doesn't work, getAdapter() doesn't have a default arg.

I think what you meant is:
>>> queryAdapter('moo', DateTime, default='xyz')
'xyz'

-- 

Paul Winkler
http://www.slinkp.com
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to