mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #27034: Removed deprecated class asynchat.fifo.
This commit is contained in:
parent
31e59aa7a2
commit
98019e1cf6
4 changed files with 10 additions and 68 deletions
|
@ -285,35 +285,6 @@ class simple_producer:
|
|||
return result
|
||||
|
||||
|
||||
class fifo:
|
||||
def __init__(self, list=None):
|
||||
import warnings
|
||||
warnings.warn('fifo class will be removed in Python 3.6',
|
||||
DeprecationWarning, stacklevel=2)
|
||||
if not list:
|
||||
self.list = deque()
|
||||
else:
|
||||
self.list = deque(list)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.list)
|
||||
|
||||
def is_empty(self):
|
||||
return not self.list
|
||||
|
||||
def first(self):
|
||||
return self.list[0]
|
||||
|
||||
def push(self, data):
|
||||
self.list.append(data)
|
||||
|
||||
def pop(self):
|
||||
if self.list:
|
||||
return (1, self.list.popleft())
|
||||
else:
|
||||
return (0, None)
|
||||
|
||||
|
||||
# Given 'haystack', see if any prefix of 'needle' is at its end. This
|
||||
# assumes an exact match has already been checked. Return the number of
|
||||
# characters matched.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue