This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients amaury.forgeotdarc, belopolsky, benjamin.peterson, georg.brandl, gvanrossum, pitrou
Date 2008-04-16.20:16:17
SpamBayes Score 0.13878562
Marked as misclassified No
Message-id <d38f5330804161248u49baeaabl563c02e98607a12c@mail.gmail.com>
In-reply-to <1208374812.41.0.631979191559.issue2603@psf.upfronthosting.co.za>
Content
On Wed, Apr 16, 2008 at 3:40 PM, Antoine Pitrou <report@bugs.python.org> wrote:
..
>  Why would you want to have hash(range(a,b,c)) == hash((a,b,c)) ?

No particular reason other than that this is easy to test and gives
some assurance that hash values are reasonable.

>  It'd be more logical to have hash(range(a,b,c)) ==
>  hash(tuple(range(a,b,c))) ... which is not the same thing at all :)

No, this is not correct because range(..) == range(..) is not the same
as tuple(range(..)) == tuple(range(..)) in the proposed
implementation.  See Guido's example above and Benjamin's test case in
the eq5 patch.
History
Date User Action Args
2008-04-16 20:16:18belopolskysetspambayes_score: 0.138786 -> 0.13878562
recipients: + belopolsky, gvanrossum, georg.brandl, amaury.forgeotdarc, pitrou, benjamin.peterson
2008-04-16 20:16:17belopolskylinkissue2603 messages
2008-04-16 20:16:17belopolskycreate