Message from discussion
Caching considered controversial
Received: by 10.58.254.39 with SMTP id af7mr539837ved.41.1347555064961;
Thu, 13 Sep 2012 09:51:04 -0700 (PDT)
X-BeenThere: sage-devel@googlegroups.com
Received: by 10.220.154.17 with SMTP id m17ls3016619vcw.1.gmail; Thu, 13 Sep
2012 09:51:03 -0700 (PDT)
Received: by 10.52.28.83 with SMTP id z19mr359415vdg.20.1347555063120;
Thu, 13 Sep 2012 09:51:03 -0700 (PDT)
Date: Thu, 13 Sep 2012 09:51:02 -0700 (PDT)
From: Volker Braun <vbraun.n...@gmail.com>
To: sage-devel@googlegroups.com
Message-Id: <8f6f2327-8ce6-448a-b679-84353356aba7@googlegroups.com>
In-Reply-To: <93ff83e3-f7a7-4ca8-b513-d5b979468cc3@q7g2000pbj.googlegroups.com>
References: <93ff83e3-f7a7-4ca8-b513-d5b979468cc3@q7g2000pbj.googlegroups.com>
Subject: Re: Caching considered controversial
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_346_29713652.1347555062522"
------=_Part_346_29713652.1347555062522
Content-Type: multipart/alternative;
boundary="----=_Part_347_20918827.1347555062530"
------=_Part_347_20918827.1347555062530
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
On Thursday, September 13, 2012 5:19:57 PM UTC+1, Nils Bruin wrote:
> sage: A==B
> True
> sage: hash(A)
> 0
> sage: hash(B)
> 44546084519852655
Really, the issue is that the objects violate the contract on
object.__hash__():
"The only required property is that objects which compare equal have the
same hash value"
http://docs.python.org/reference/datamodel.html
------=_Part_347_20918827.1347555062530
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
On Thursday, September 13, 2012 5:19:57 PM UTC+1, Nils Bruin wrote:<br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">sage: A==B
<br>True
<br>sage: hash(A)
<br>0
<br>sage: hash(B)
<br>44546084519852655 </blockquote><div><br></div><div>Really, the issue is that the objects violate the contract on object.__hash__():</div><div><br></div><div>"The only required property is that objects which compare equal have the same hash value"<br></div><div><br></div><div>http://docs.python.org/reference/datamodel.html<br></div><div><br></div>
------=_Part_347_20918827.1347555062530--
------=_Part_346_29713652.1347555062522--