summaryrefslogtreecommitdiff
path: root/Lib/asynchat.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-02-29 02:15:56 +0000
committerRaymond Hettinger <python@rcn.com>2004-02-29 02:15:56 +0000
commit80efc580eed55de46c7c8d61453266d334f24114 (patch)
treeba1ba1fa4c2eda2c4f07e9d25b0e213f93bb49fa /Lib/asynchat.py
parent1960cf66c7bf901d7c64cb6f5414ca622140e305 (diff)
downloadcpython-80efc580eed55de46c7c8d61453266d334f24114.tar.gz
Improvements to collections.deque():
* Add doctests for the examples in the library reference. * Add two methods, left() and right(), modeled after deques in C++ STL. * Apply the new method to asynchat.py. * Add comparison operators to make deques more substitutable for lists. * Replace the LookupErrors with IndexErrors to more closely match lists.
Diffstat (limited to 'Lib/asynchat.py')
-rw-r--r--Lib/asynchat.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/asynchat.py b/Lib/asynchat.py
index 4bfab302a1..2c0bc3e902 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -262,11 +262,7 @@ class fifo:
return self.list == []
def first (self):
- it = iter(self.list)
- try:
- return it.next()
- except StopIteration:
- raise IndexError
+ return self.list.left()
def push (self, data):
self.list.append(data)