[Python-checkins] r79425 - in python/trunk/Lib: idlelib/PyShell.py lib-tk/turtle.py

florent.xicluna python-checkins at python.org
Thu Mar 25 21:32:07 CET 2010


Author: florent.xicluna
Date: Thu Mar 25 21:32:07 2010
New Revision: 79425
Log:
Syntax cleanup `== None` -> `is None`
Modified:
 python/trunk/Lib/idlelib/PyShell.py
 python/trunk/Lib/lib-tk/turtle.py
Modified: python/trunk/Lib/idlelib/PyShell.py
==============================================================================
--- python/trunk/Lib/idlelib/PyShell.py	(original)
+++ python/trunk/Lib/idlelib/PyShell.py	Thu Mar 25 21:32:07 2010
@@ -350,7 +350,7 @@
 rpcpid = None
 
 def spawn_subprocess(self):
- if self.subprocess_arglist == None:
+ if self.subprocess_arglist is None:
 self.subprocess_arglist = self.build_subprocess_arglist()
 args = self.subprocess_arglist
 self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args)
Modified: python/trunk/Lib/lib-tk/turtle.py
==============================================================================
--- python/trunk/Lib/lib-tk/turtle.py	(original)
+++ python/trunk/Lib/lib-tk/turtle.py	Thu Mar 25 21:32:07 2010
@@ -783,7 +783,7 @@
 # needs amendment
 if not isinstance(self.cv, ScrolledCanvas):
 return self.canvwidth, self.canvheight
- if canvwidth is None and canvheight is None and bg is None:
+ if canvwidth is canvheight is bg is None:
 return self.cv.canvwidth, self.cv.canvheight
 if canvwidth is not None:
 self.canvwidth = canvwidth
@@ -999,7 +999,7 @@
 >>> mode()
 'logo'
 """
- if mode == None:
+ if mode is None:
 return self._mode
 mode = mode.lower()
 if mode not in ["standard", "logo", "world"]:
@@ -1339,7 +1339,7 @@
 ### repeatedly pressing the up-arrow key,
 ### consequently drawing a hexagon
 """
- if fun == None:
+ if fun is None:
 if key in self._keys:
 self._keys.remove(key)
 elif key not in self._keys:
@@ -1460,7 +1460,7 @@
 def _setmode(self, mode=None):
 """Set turtle-mode to 'standard', 'world' or 'logo'.
 """
- if mode == None:
+ if mode is None:
 return self._mode
 if mode not in ["standard", "logo", "world"]:
 return
@@ -2704,7 +2704,7 @@
 >>> turtle.shapesize(5, 5, 12)
 >>> turtle.shapesize(outline=8)
 """
- if stretch_wid is None and stretch_len is None and outline == None:
+ if stretch_wid is stretch_len is outline is None:
 stretch_wid, stretch_len = self._stretchfactor
 return stretch_wid, stretch_len, self._outlinewidth
 if stretch_wid is not None:


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /