[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Patch was committed in r62043. Wummel, thanks for the patch! Georg, thanks for the practice. -- status: open -> closed __ Tracker <[EMAIL PROTECTED]> _

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Don't think changes like this warrant a NEWS entry. It's a code clean- up, not a semantic change. __ Tracker <[EMAIL PROTECTED]> __ ___

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Benjamin, do you want to apply this? Add a Misc/NEWS item as well. -- assignee: -> benjamin.peterson nosy: +benjamin.peterson __ Tracker <[EMAIL PROTECTED]> __

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: This patch is fine. Before applying, check the code in PyShell to see if the "if response is False" line can be simplified to "if not response". -- nosy: +rhettinger resolution: -> accepted __ Tr

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Wummel
Changes by Wummel <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file9882/0001-Replace-None-True-False-with-is.patch __ Tracker <[EMAIL PROTECTED]> __ _

[issue2503] Replace "== None/True/False" with "is"

2008-03-29 Thread Wummel
Wummel <[EMAIL PROTECTED]> added the comment: Here is an updated patch, using "is False" to be consistent, and also replacing the "!=" occurences. Added file: http://bugs.python.org/file9886/0001-Replace-None-True-False-with-is.patch __ Tracker <[EMAIL PROTECTED

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Despite the title, the patch replaces "result == False" with "not result" rather than "result is False". While probably ok in this particular context, this changes the logic. For example, >>> result = "" >>> result == False False >>

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Wummel
Wummel <[EMAIL PROTECTED]> added the comment: Amaury, I never saw an object comparing equal to None. I think the most likely case is a buggy x.__eq__() implementation. Then the "if x == None" statement gets triggered, and somebody has a hard time with bug hunting. Just a note: I used an adapted

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Yes, PEP8 says:: Comparisons to singletons like None should always be done with 'is' or 'is not', never the equality operators. Reading the patch: - a change modifies "x == False" into "not x", another moves some lines. I check

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I'm in favor of this patch. Not only is "is" faster here, but it is also way more idiomatic. -- nosy: +georg.brandl __ Tracker <[EMAIL PROTECTED]> _

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: You are right of course, but just out of curiosity, do you really have objects that compare equal to None? -- nosy: +amaury.forgeotdarc __ Tracker <[EMAIL PROTECTED]>

[issue2503] Replace "== None/True/False" with "is"

2008-03-28 Thread Wummel
New submission from Wummel <[EMAIL PROTECTED]>: Test equality with None/True/False singletons should be done by "is" rather than "==" to be on the safe side. Otherwise objects overriding __eq__ could compare equal to one of those singletons. -- components: None files: 0001-Replace-None-T