[New-bugs-announce] [issue10356] decimal.py: hash of -1

Stefan Krah report at bugs.python.org
Mon Nov 8 13:34:03 CET 2010

New submission from Stefan Krah <stefan-usenet at bytereef.org>:

When the __hash__ method is called directly, the hash of -1
is -1:

>>> from decimal import *
>>> Decimal(-1).__hash__()
>>> hash(Decimal(-1))

I've a patch, which also sneaks in a ValueError.

components: Library (Lib)
files: decimal_hash.patch
keywords: needs review, patch
messages: 120738
nosy: mark.dickinson, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: decimal.py: hash of -1
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file19543/decimal_hash.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list