Re: object identity and hashing

2008-02-27 Thread castironpi
On Feb 25, 7:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > >> [1]http://www.martinfowler.com/eaaCatalog/identityMap.html > > > [1] illustrates a case in which 'a is a' returns False, and in the > > other

Re: object identity and hashing

2008-02-25 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> >> [1]http://www.martinfowler.com/eaaCatalog/identityMap.html > > [1] illustrates a case in which 'a is a' returns False, and in the > other corner of the DeMorgan table, there is 'a is b' returns True for >

Re: object identity and hashing

2008-02-25 Thread castironpi
> But this doesn't tell you anything about Python except that it's > flexible enough to construct counter-intuitive classes. > > Everything you have been told is true for the normal cases you will come > across in everyday usage. If you want to play in the obscure corners of > the language that's f

Re: object identity and hashing

2008-02-25 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> On Feb 24, 9:11 pm, [EMAIL PROTECTED] wrote: >> >> >> >> >> >>> On Feb 24, 7:58 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: > Can someone explain this? a= {} Cre

Re: object identity and hashing

2008-02-24 Thread castironpi
On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Feb 24, 9:11 pm, [EMAIL PROTECTED] wrote: > > > > > > > On Feb 24, 7:58 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > > Can someone explain this? > > > > a= {} > > > > Create an empty dict and

Re: object identity and hashing

2008-02-24 Thread George Sakkis
On Feb 24, 9:11 pm, [EMAIL PROTECTED] wrote: > On Feb 24, 7:58 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > Can someone explain this? > > > a= {} > > > Create an empty dict and bind it to the name a. > > > a[(3,)]= 0 > > > Set the key/value pair (3,)

Re: object identity and hashing

2008-02-24 Thread castironpi
On Feb 24, 7:58 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Can someone explain this? > > a= {} > > Create an empty dict and bind it to the name a. > > a[(3,)]= 0 > > Set the key/value pair (3,):0 to the dict. > > (3,) in a > > Is (3,) one of the keys in

Re: object identity and hashing

2008-02-24 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Can someone explain this? > a= {} Create an empty dict and bind it to the name a. a[(3,)]= 0 Set the key/value pair (3,):0 to the dict. (3,) in a Is (3,) one of the keys in the dict? > True Yes, it is. (3,) is (3,) Create two separate tuples

object identity and hashing

2008-02-24 Thread castironpi
Can someone explain this? >>> a= {} >>> a[(3,)]= 0 >>> (3,) in a True >>> (3,) is (3,) False -- http://mail.python.org/mailman/listinfo/python-list