R. David Murray added the comment: We'll have to wait for Nick to chime in, but I'll make a couple of comments.
First, I think this is a bug in partial, so I think we need to decide what, if anything, to do about that first, before we decide if signature needs to compensate for it or not. The other comment is about ==/__hash__, in case that is involved in the solution: two objects may very well have the same __hash__ and *not* be equal, but they cannot have different __hash__es and *be* equal. The equality comparison algorithm uses __hash__ as a shortcut. If two objects have different hashes, they are not equal and we return False. If they have the same hash, then a full equality comparison is done before the result of __eq__ is returned. You will understand that this must be the case if you think about the nature of hashing: it throws away information. Cryptographic hashes used for identification are constructed such that the *probability* of a collision is very low, but it is still not zero, so how they are used is just as important as how they work. Our __hash__es are generally not that strong, so collision is likely. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21117> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com