[New-bugs-announce] [issue11983] Inconsistent hash and comparison for code objects

Eugene Toder report at bugs.python.org
Tue May 3 04:11:22 CEST 2011

New submission from Eugene Toder <eltoder at gmail.com>:

A comment in the definition of PyCodeObject in Include/code.h says:

/* The rest doesn't count for hash or comparisons */

which, I think, makes a lot of sense. The implementation doesn't follow this comment, though. code_hash actually includes co_name and code_richcompare includes co_name and co_firstlineno. This makes hash and comparison inconsistent with each other and with the comment.

components: Interpreter Core
messages: 135015
nosy: eltoder
priority: normal
severity: normal
status: open
title: Inconsistent hash and comparison for code objects
type: behavior
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list