Re: Pragmatics of the standard is() function

2011-11-29 Thread Den
On Nov 29, 12:41 am, Steven D'Aprano wrote: > On Mon, 28 Nov 2011 11:22:09 -0800, Den wrote: > > With respect, I disagree with advice that the use of a language > > construct should be rare.  All constructs should be used > > *appropriately*. > > And if those appropriate conditions are rare, then

Re: Pragmatics of the standard is() function

2011-11-29 Thread Steven D'Aprano
On Mon, 28 Nov 2011 11:22:09 -0800, Den wrote: > With respect, I disagree with advice that the use of a language > construct should be rare. All constructs should be used > *appropriately*. And if those appropriate conditions are rare, then the use of the appropriate construct should also be ra

Re: Pragmatics of the standard is() function

2011-11-28 Thread alex23
On Nov 29, 5:22 am, Den wrote: > On Nov 26, 3:01 pm, Steven D'Aprano > That is correct. You probably should rarely use `is`. Apart from testing > > for None, use of `is` should be rare. > > With respect, I disagree with advice that the use of a language > construct should be rare.  All constructs

Re: Pragmatics of the standard is() function

2011-11-28 Thread Ethan Furman
Den wrote: With respect, I disagree with advice that the use of a language construct should be rare. All constructs should be used *appropriately*. +1 ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Pragmatics of the standard is() function

2011-11-28 Thread Den
On Nov 26, 3:01 pm, Steven D'Aprano wrote: > On Sat, 26 Nov 2011 22:20:36 +0100, candide wrote: >>SNIP<< > > That is correct. You probably should rarely use `is`. Apart from testing > for None, use of `is` should be rare. > > -- > Steven With respect, I disagree with advice that the use of a lang

Re: Pragmatics of the standard is() function

2011-11-28 Thread Jean-Michel Pichavant
candide wrote: In which cases should we use the is() function ? The is() function compares identity of objects rather than values so I was wondering in which circumstances comparing identities of objects is really vital. Examining well reputated Python source code, I realize that is() functio

Re: Pragmatics of the standard is() function

2011-11-26 Thread Steven D'Aprano
On Sat, 26 Nov 2011 22:20:36 +0100, candide wrote: > In which cases should we use the is() function ? The is() function > compares identity of objects rather than values so I was wondering in > which circumstances comparing identities of objects is really vital. `is` is not a function. It is a ke

Re: Pragmatics of the standard is() function

2011-11-26 Thread Alexander Kapps
On 26.11.2011 22:20, candide wrote: You already got answers for the "is" vs. "==" difference. I'd like to add the following. In which cases should we use the is() function ? "is" is not a function, It's an operator, just like == or +. is() function makes comparaison of (abstract represent

Re: Pragmatics of the standard is() function

2011-11-26 Thread Chris Angelico
On Sun, Nov 27, 2011 at 8:20 AM, candide wrote: > is() function makes comparaison of (abstract representation of) adresses of > objects in memory. Comparing addresses of objects is a low level feature > performed by low level langages such as C but seldom needed in high level > languages like Pyth

Re: Pragmatics of the standard is() function

2011-11-26 Thread Roy Smith
In article <4ed15825$0$21841$426a3...@news.free.fr>, candide wrote: > In which cases should we use the is() function ? The is() function > compares identity of objects rather than values so I was wondering in > which circumstances comparing identities of objects is really vital. > > Examining

Pragmatics of the standard is() function

2011-11-26 Thread candide
In which cases should we use the is() function ? The is() function compares identity of objects rather than values so I was wondering in which circumstances comparing identities of objects is really vital. Examining well reputated Python source code, I realize that is() function is mainly used