summaryrefslogtreecommitdiffstats
path: root/Lib/cmd.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-30 03:39:14 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-30 03:39:14 (GMT)
commit46ac8eb3c899b498299a2f8fbcdd4ed3f32addba (patch)
treebcbe8646fceabec7bcdc4c365f6389fb537fdb68 /Lib/cmd.py
parent78e057a32a92c3bfb464b27a02f4931c474769e8 (diff)
downloadcpython-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.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/cmd.py b/Lib/cmd.py
index f20c1bb..6d9efff 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -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):