[Zope3-dev] Re: adapter registration question

Chris Withers chris at simplistix.co.uk
Tue Nov 14 03:43:59 EST 2006


Tres Seaver wrote:
> Heh, in this case using 'IString' is really a "trussed duck" (duck
> typing with B&D) ;)  Python's duck typing breaks down with strings,
> because they can by "quack tested" like sequences, but you almost
> *never* want to treat them the same way as other sequences, so you end
> up with 'isinstance(obj, basestr)' tests to prevent handling them that way.

True, and I guess for my uses, I'd be wanting to register adapter both 
too and from basestr, since that'd cover unicodes too, unless that would 
be bad ;)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope3-dev mailing list