diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-30 03:39:14 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-30 03:39:14 (GMT) |
commit | 46ac8eb3c899b498299a2f8fbcdd4ed3f32addba (patch) | |
tree | bcbe8646fceabec7bcdc4c365f6389fb537fdb68 /Lib/cmd.py | |
parent | 78e057a32a92c3bfb464b27a02f4931c474769e8 (diff) | |
download | cpython-46ac8eb3c899b498299a2f8fbcdd4ed3f32addba.zip cpython-46ac8eb3c899b498299a2f8fbcdd4ed3f32addba.tar.gz cpython-46ac8eb3c899b498299a2f8fbcdd4ed3f32addba.tar.bz2 |
Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)
Diffstat (limited to 'Lib/cmd.py')
-rw-r--r-- | Lib/cmd.py | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -109,8 +109,7 @@ class Cmd: stop = None while not stop: if self.cmdqueue: - line = self.cmdqueue[0] - del self.cmdqueue[0] + line = self.cmdqueue.pop(0) else: if self.use_rawinput: try: @@ -261,11 +260,10 @@ class Cmd: names = [] classes = [self.__class__] while classes: - aclass = classes[0] + aclass = classes.pop(0) if aclass.__bases__: classes = classes + list(aclass.__bases__) names = names + dir(aclass) - del classes[0] return names def complete_help(self, *args): |