From: Adam B. <ad...@po...> - 2002-07-29 08:58:56
|
On Mon, Jul 29, 2002 at 03:04:49AM +0200, Gerhard H=E4ring wrote: > > > 123.45 =3D=3D None > > 123.45 is None: > > I thought comparing to None via equality was bad form? > Indeed. I learnt that in a thread you started on c.l.py. All comparison= s > to None using =3D=3D are now gone since the 2.1 release, btw. OK, You're right. I am not subscribed to c.l.py, although after reading this above I think I should. :/ Indeed, "is" operator is much more suitable for this purpose and is faster. Now I see that my knowledge of Python isn't simply good enough -- there are still problems like this that can be solved in different ways, and my solutions are sometimes not the best ones. :( I used to write "x =3D=3D None" because I had read in Python manual that "most other types compare unequal unless they are the same object", so everything except None should not be equal to None. And it worked until pyPgSQL 2.1 which broke some my existing applications. And instead of looking into changelog, I assumed that this could be a lack of "standard" behaviour of PgNumeric. It was lame, I know now :)) Thanks a lot! --=20 Adam Buraczewski <ad...@po...> * Linux registered user #165585 GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w-- O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y? |