-----BEGIN PGP SIGNED MESSAGE-----
Philipp von Weitershausen wrote:
> Tres Seaver wrote:
>> Thnk of cataloguing / indexing use cases: adapting the catalogued
>> object to a string value (or tuple, or whatever) using named adapters is
>> a very "natural" way to make indexing pluggable: what is *unnatural*
>> (or at least a "dead chicken") is the requirement to adapt to an
>> 'IString', when what I really want is a 'str'.
> Well, part of Python idea is duck typing and requiring that you get a
> 'str' may be too much. Perhaps you would really only like to get
> something that quacks like str. OTOH, perhaps you absolutely want a
> 'str' and that use case should perhaps be allowed...
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.
Tres Seaver +1 202-558-7113 [EMAIL PROTECTED]
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v126.96.36.199 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Zope3-dev mailing list