New submission from Stefan Krah <stefan-use...@bytereef.org>:

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

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


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 <rep...@bugs.python.org>
<http://bugs.python.org/issue10356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to