-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philipp von Weitershausen wrote:
> Tres Seaver wrote:

<snip>

>> 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.
- --
===================================================================
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFWLUf+gerLs4ltQ4RAt/1AKCUvR230iCgNOq7kUpqAcFrSQVp5wCfedXY
WI/ty3z7ektpMS/9Mh+l/PI=
=IM7g
-----END PGP SIGNATURE-----

_______________________________________________
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