Collin Winter wrote:
> On 7/25/06, Andrew Koenig <[EMAIL PROTECTED]> wrote:
>>> With your CD example, you need an external resource (the CD itself) in
>>> order to calculate the hash - in that case, you can't safely defer
>>> the hash calculation until the first time you know you need it,
>>> since you don't know whether or not you'll have access to the
>>> physical CD at that point.
>> OK.  Then instead of a CD, use a (read-only) disk file.  The example is
>> still valid in that case, and avoids the extraneous matter of operator
>> intervention.
> 
> Oh, please. No-one's arguing that hashes MUST be fast to compute; it's
> just a good rule of thumb. There will of course be exceptional cases,
> like the contrived examples you've come up with, but they're just
> that: exceptional. If you find yourself writing classes that must hash
> a large on-disk file or CD or whatever else, you can add custom tests
> for hashability yourself. There's no need to clutter the language to
> cater to every odd corner case someone digs up.

Very well said and I couldn't agree more.

+1 for not adding hashable() to the language.

Stefan

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to