Em Seg, 2006-03-27 às 08:23 -0500, Dan Sommers escreveu: > On Mon, 27 Mar 2006 14:52:46 +0200, > Joel Hedlund <[EMAIL PROTECTED]> wrote: > > > ... According to PEP8 (python programming style guidelines) you should > > use 'is' when comparing to singletons like None. I take this to also > > include constants and such ... > > This does *not* also mean constants and such: > > Python 2.4.2 (#1, Feb 22 2006, 08:02:53) > [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> a = 123456789 > >>> a == 123456789 > True > >>> a is 123456789 > False > >>>
Not those kind of constants, but this one: Python 2.4.2 (#2, Nov 20 2005, 17:04:48) [GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> CONST = 123456789 >>> a = CONST >>> a == CONST True >>> a is CONST True >>> -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list