Hi, everyone.
OK, I got it now! The value of the hash is not decisive, as __eq__
will still be called when the hashes match. It's like a filter, for
performance reasons.
It's really nice, I just tried it and it worked.
Thank you very, very much!!
Cheers,
- Gustavo.
--
http://mail.python.or
On 2009-06-20 18:22, Terry Reedy wrote:
Gustavo Narea wrote:
Hello again, everybody.
Thank you very much for your responses. You guessed right, I didn't
use the __hash__ method (and I forgot to mention that, sorry).
And unfortunately, I think I can't make them hashable, because the
objects are
Gustavo Narea wrote:
Hello again, everybody.
Thank you very much for your responses. You guessed right, I didn't
use the __hash__ method (and I forgot to mention that, sorry).
And unfortunately, I think I can't make them hashable, because the
objects are compared based on their attributes, whic
On Jun 20, 9:27 am, MRAB wrote:
> Gustavo Narea wrote:
> > Hello again, everybody.
>
> > Thank you very much for your responses. You guessed right, I didn't
> > use the __hash__ method (and I forgot to mention that, sorry).
>
> > And unfortunately, I think I can't make them hashable, because the
>
On 2009-06-20 11:27, MRAB wrote:
Gustavo Narea wrote:
Hello again, everybody.
Thank you very much for your responses. You guessed right, I didn't
use the __hash__ method (and I forgot to mention that, sorry).
And unfortunately, I think I can't make them hashable, because the
objects are compar
En Sat, 20 Jun 2009 12:50:41 -0300, Gustavo Narea
escribió:
Thank you very much for your responses. You guessed right, I didn't
use the __hash__ method (and I forgot to mention that, sorry).
And unfortunately, I think I can't make them hashable, because the
objects are compared based on thei
Gustavo Narea wrote:
Hello again, everybody.
Thank you very much for your responses. You guessed right, I didn't
use the __hash__ method (and I forgot to mention that, sorry).
And unfortunately, I think I can't make them hashable, because the
objects are compared based on their attributes, whic
Gustavo Narea wrote:
> Hello again, everybody.
>
> Thank you very much for your responses. You guessed right, I didn't
> use the __hash__ method (and I forgot to mention that, sorry).
>
> And unfortunately, I think I can't make them hashable, because the
> objects are compared based on their att
Hello again, everybody.
Thank you very much for your responses. You guessed right, I didn't
use the __hash__ method (and I forgot to mention that, sorry).
And unfortunately, I think I can't make them hashable, because the
objects are compared based on their attributes, which are in turn
other kin
On Jun 19, 12:42 pm, Chris Rebert wrote:
> On Fri, Jun 19, 2009 at 12:02 PM, Gustavo Narea wrote:
> > Hello, everyone.
>
> > I've noticed that if I have a class with so-called "rich comparison"
> > methods
> > (__eq__, __ne__, etc.), when its instances are included in a set,
> > set.__contains__/_
On Fri, Jun 19, 2009 at 12:02 PM, Gustavo Narea wrote:
> Hello, everyone.
>
> I've noticed that if I have a class with so-called "rich comparison"
> methods
> (__eq__, __ne__, etc.), when its instances are included in a set,
> set.__contains__/__eq__ won't call the .__eq__ method of the elements
>
Gustavo Narea wrote:
> I've noticed that if I have a class with so-called "rich comparison"
> methods
> (__eq__, __ne__, etc.), when its instances are included in a set,
> set.__contains__/__eq__ won't call the .__eq__ method of the elements
> and thus
> the code below:
> """
> obj1 = RichComparis
On Fri 19 Jun 2009 03:02:44 PM EDT, Gustavo Narea wrote:
> Hello, everyone.
>
> I've noticed that if I have a class with so-called "rich comparison"
> methods
> (__eq__, __ne__, etc.), when its instances are included in a set,
> set.__contains__/__eq__ won't call the .__eq__ method of the elements
Hello, everyone.
I've noticed that if I have a class with so-called "rich comparison"
methods
(__eq__, __ne__, etc.), when its instances are included in a set,
set.__contains__/__eq__ won't call the .__eq__ method of the elements
and thus
the code below:
"""
obj1 = RichComparisonClass()
obj2 = Ric
14 matches
Mail list logo