[issue2198] code_hash() can be the same for different code objects

2008-03-17 Thread Jeffrey Yasskin
Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment: Given Alexander's comment, and the fact that x==x must imply hash(x)==hash(x) but the reverse need not be true, this seems like intentional behavior. -- nosy: +jyasskin resolution: -> invalid status: open -> closed

[issue2198] code_hash() can be the same for different code objects

2008-03-03 Thread Paul Pogonyshev
Paul Pogonyshev added the comment: Hashes being equal for different objects cannot be a bug. At most an enhancement request... -- nosy: +_doublep __ Tracker <[EMAIL PROTECTED]> __ ___

[issue2198] code_hash() can be the same for different code objects

2008-03-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would say filename/lineno are excluded from hash on purpose because they are ignored in comparisons: >>> compile("0", "a", "eval") == compile("0", "b", "eval") True Include/code.h has the following comment: /* The rest doesn't count for hash/cmp */

[issue2198] code_hash() can be the same for different code objects

2008-02-27 Thread Stephan R.A. Deibel
Stephan R.A. Deibel added the comment: I should have noted that adding co_firstlineno as well to the hash would be necessary to distinguish like code objects within the same file. The example has them on the same lines in different files but changing the first line of the defs doesn't matter. _

[issue2198] code_hash() can be the same for different code objects

2008-02-27 Thread Stephan R.A. Deibel
New submission from Stephan R.A. Deibel: The algorithm in code_hash() in codeobject.c can return the same hash value for different code objects. Presumably distinct code objects should be very unlikely to have the same hash value. This bug affected our debugger before we worked around it, and