On Sat, 21 May 2011 15:55:56 -0700, John Nagle wrote:
> On 5/19/2011 11:33 PM, Ulrich Eckhardt wrote:
>
>> For that reason, it is generally useful to use immutable types like
>> integers, floats, strings and tuples thereof as keys. Since you can't
>> change them, you basically have the guarantee
On 22-5-2011 0:55, John Nagle wrote:
> On 5/19/2011 11:33 PM, Ulrich Eckhardt wrote:
>
>> For that reason, it is generally useful to use immutable types like
>> integers, floats, strings and tuples thereof as keys. Since you can't change
>> them, you basically have the guarantee that they hash the
On 5/19/2011 11:33 PM, Ulrich Eckhardt wrote:
For that reason, it is generally useful to use immutable types like
integers, floats, strings and tuples thereof as keys. Since you can't change
them, you basically have the guarantee that they hash the same.
Right. It's something of a lack tha
Gregory Ewing wrote:
> Ethan Furman wrote:
>> Ulrich Eckhardt wrote:
>>
>>> If two equal objects have different hashes, they
>>> will be stored in different places in the hash map. Looking for
>>> object1 will then not turn up with object2, even though they are equal.
>>
>> In this case this is
Ethan Furman wrote:
Ulrich Eckhardt wrote:
If two equal objects have different hashes, they
will be stored in different places in the hash map. Looking for
object1 will then not turn up with object2, even though they are equal.
In this case this is the behavior I want.
You can't rely on i
On Sat, 21 May 2011 02:02:48 +0100, MRAB wrote:
> On 21/05/2011 01:47, Steven D'Aprano wrote:
>> On Fri, 20 May 2011 21:17:29 +0100, MRAB wrote:
>>
>>> On 20/05/2011 20:01, Christian Heimes wrote:
Am 20.05.2011 17:50, schrieb MRAB:
> Is this strictly true? I thought that the hash value, a
On 21/05/2011 01:47, Steven D'Aprano wrote:
On Fri, 20 May 2011 21:17:29 +0100, MRAB wrote:
On 20/05/2011 20:01, Christian Heimes wrote:
Am 20.05.2011 17:50, schrieb MRAB:
Is this strictly true? I thought that the hash value, an integer, is
moduloed (Is that how you spell it? Looks weird!) ..
On Fri, 20 May 2011 21:17:29 +0100, MRAB wrote:
> On 20/05/2011 20:01, Christian Heimes wrote:
>> Am 20.05.2011 17:50, schrieb MRAB:
>>> Is this strictly true? I thought that the hash value, an integer, is
>>> moduloed (Is that how you spell it? Looks weird!) ...
>>
>> I don't think 'moduloed' is
Peter Otten wrote:
Ethan Furman wrote:
Peter Otten wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
--> class Wierd():
... def __init__(self
Ethan Furman wrote:
> Peter Otten wrote:
>> Ethan Furman wrote:
>>
>>> Several folk have said that objects that compare equal must hash equal,
>>> and the docs also state this
>>> http://docs.python.org/dev/reference/datamodel.html#object.__hash__
>>>
>>> I'm hoping somebody can tell me what horr
On 20/05/2011 20:01, Christian Heimes wrote:
Am 20.05.2011 17:50, schrieb MRAB:
Is this strictly true? I thought that the hash value, an integer, is
moduloed (Is that how you spell it? Looks weird!) with the number of
array elements to give an index into the array, so different hashes
could give
Am 20.05.2011 17:50, schrieb MRAB:
> Is this strictly true? I thought that the hash value, an integer, is
> moduloed (Is that how you spell it? Looks weird!) with the number of
> array elements to give an index into the array, so different hashes
> could give the same index, and objects with differ
On Fri, May 20, 2011 at 10:56 AM, Ethan Furman wrote:
> Chris Rebert wrote:
>> On Thu, May 19, 2011 at 10:43 PM, Ethan Furman wrote:
>>> Several folk have said that objects that compare equal must hash equal,
>>> and
>>> the docs also state this
>>> http://docs.python.org/dev/reference/datamodel.
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
Two things I didn't make clear originally:
I'm using Python3.
My objects (of type Wierd) obey the prem
Ulrich Eckhardt wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what horrible thing will happen if this
isn't the c
On Fri, May 20, 2011 at 10:36 AM, Chris Kaynor wrote:
> I think the question was: can this dummy code ever produce a set containing
> less then itemCount items (for 0 < itemCount < 2**32)?
In CPython, no. Even when you get a hash collision, the code checks
to see whether the hashes are actually
Peter Otten wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what horrible thing will happen if this
isn't the case
Chris Rebert wrote:
On Thu, May 19, 2011 at 10:43 PM, Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal, and
the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what horrible thing
On Fri, May 20, 2011 at 9:20 AM, Chris Angelico wrote:
> On Sat, May 21, 2011 at 1:50 AM, MRAB wrote:
> > [snip]
> > Is this strictly true? I thought that the hash value, an integer, is
> > moduloed (Is that how you spell it? Looks weird!) with the number of
> > array elements to give an index i
On Sat, May 21, 2011 at 1:50 AM, MRAB wrote:
> [snip]
> Is this strictly true? I thought that the hash value, an integer, is
> moduloed (Is that how you spell it? Looks weird!) with the number of
> array elements to give an index into the array, so different hashes
> could give the same index, and
On 20/05/2011 07:33, Ulrich Eckhardt wrote:
Ethan Furman wrote:
Several folk have said that objects that compare equal must hash equal,
and the docs also state this
http://docs.python.org/dev/reference/datamodel.html#object.__hash__
I'm hoping somebody can tell me what horrible thing will happe
Ethan Furman wrote:
> Several folk have said that objects that compare equal must hash equal,
> and the docs also state this
> http://docs.python.org/dev/reference/datamodel.html#object.__hash__
>
> I'm hoping somebody can tell me what horrible thing will happen if this
> isn't the case?
If you w
On Thu, May 19, 2011 at 10:43 PM, Ethan Furman wrote:
> Several folk have said that objects that compare equal must hash equal, and
> the docs also state this
> http://docs.python.org/dev/reference/datamodel.html#object.__hash__
>
> I'm hoping somebody can tell me what horrible thing will happen i
Ethan Furman wrote:
> Several folk have said that objects that compare equal must hash equal,
> and the docs also state this
> http://docs.python.org/dev/reference/datamodel.html#object.__hash__
>
> I'm hoping somebody can tell me what horrible thing will happen if this
> isn't the case? Here's
24 matches
Mail list logo