Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
asynchat.fifo Class Reference

List of all members.

Public Member Functions

def __init__
def __len__
def is_empty
def first
def push
def pop

Public Attributes

 list

Detailed Description

Definition at line 292 of file asynchat.py.


Constructor & Destructor Documentation

def asynchat.fifo.__init__ (   self,
  list = None 
)

Definition at line 293 of file asynchat.py.

00293 
00294     def __init__ (self, list=None):
00295         if not list:
00296             self.list = deque()
00297         else:
00298             self.list = deque(list)

Here is the caller graph for this function:


Member Function Documentation

def asynchat.fifo.__len__ (   self)

Definition at line 299 of file asynchat.py.

00299 
00300     def __len__ (self):
00301         return len(self.list)

def asynchat.fifo.first (   self)

Definition at line 305 of file asynchat.py.

00305 
00306     def first (self):
00307         return self.list[0]

def asynchat.fifo.is_empty (   self)

Definition at line 302 of file asynchat.py.

00302 
00303     def is_empty (self):
00304         return not self.list

def asynchat.fifo.pop (   self)

Definition at line 311 of file asynchat.py.

00311 
00312     def pop (self):
00313         if self.list:
00314             return (1, self.list.popleft())
00315         else:
00316             return (0, None)
00317 
00318 # Given 'haystack', see if any prefix of 'needle' is at its end.  This
00319 # assumes an exact match has already been checked.  Return the number of
00320 # characters matched.
00321 # for example:
00322 # f_p_a_e ("qwerty\r", "\r\n") => 1
00323 # f_p_a_e ("qwertydkjf", "\r\n") => 0
00324 # f_p_a_e ("qwerty\r\n", "\r\n") => <undefined>
00325 
00326 # this could maybe be made faster with a computed regex?
00327 # [answer: no; circa Python-2.0, Jan 2001]
00328 # new python:   28961/s
00329 # old python:   18307/s
00330 # re:        12820/s
00331 # regex:     14035/s

Here is the caller graph for this function:

def asynchat.fifo.push (   self,
  data 
)

Definition at line 308 of file asynchat.py.

00308 
00309     def push (self, data):
00310         self.list.append(data)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 295 of file asynchat.py.


The documentation for this class was generated from the following file: