Marcin 'Qrczak' Kowalczyk wrote: > Stefan Behnel <[EMAIL PROTECTED]> writes: > >> It just says: I support the protocol, so it makes sense to apply the >> protocol operations to me if you need to. >> >> I think that's perfectly reasonable semantics for the three functions. > > I see no essential difference between an object which doesn't support > a protocol at all, and an object for which using the given protocol > always fails. > > What is hashable() useful for, especially if so loosely defined?
Well, if you /know/ it always fails, you should best disable it by setting it to None, right? So, if hashable() returns True, it means that a) the designer didn't care about switching it off or b) there are cases where it works, so it makes sense to try calling it. The first case (i.e. the one you described) is bad design and therefore ignorable, the second fits the above semantics. Stefan _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
