A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-April/044229.html below:

[Python-Dev] Re: Decimal data type issues

[Python-Dev] Re: Decimal data type issuesPaul Moore pf_moore at yahoo.co.uk
Tue Apr 13 16:34:51 EDT 2004
"Batista, Facundo" <FBatista at uniFON.com.ar> writes:

[...]

> Actually, imposing the limit means more code and complexity, and I don't
> find any benefit.  But as I answered to Paul, I'm searching for community
> agreement before changing functionality that I found in the implementation

[...]

> So, while Decimal(25) == 25 is True, hash(Decimal(25)) should be equal to
> hash(25).
>
> The detail is that you can NOT compare Decimal to floats or strings, so
> maybe we should not worry about them to give the same hashes.
>
> I'm OK to make hash(int or long) == hash(Decimal(int or long)). But only to
> int or long, not float nor string.
>
> Do you agree?

So far, I've found your instincts to be pretty good. I'd say

1. Remove the limits.
2. Make hashes the same for int/long, but not str/float.
3. While I'm at it, I'm OK with the names you suggest for the 3 extra
   functions.

Paul.
-- 
This signature intentionally left blank


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4