Back to index

python3.2  3.2.2
Classes | Functions
asynchat Namespace Reference

Classes

class  async_chat
class  simple_producer
class  fifo

Functions

def buffer
def find_prefix_at_end

Function Documentation

def asynchat.buffer (   obj,
  start = None,
  stop = None 
)

Definition at line 52 of file asynchat.py.

00052 
00053 def buffer(obj, start=None, stop=None):
00054     # if memoryview objects gain slicing semantics,
00055     # this function will change for the better
00056     # memoryview used for the TypeError
00057     memoryview(obj)
00058     if start == None:
00059         start = 0
00060     if stop == None:
00061         stop = len(obj)
00062     x = obj[start:stop]
00063     ## print("buffer type is: %s"%(type(x),))
00064     return x

Here is the caller graph for this function:

def asynchat.find_prefix_at_end (   haystack,
  needle 
)

Definition at line 332 of file asynchat.py.

00332 
00333 def find_prefix_at_end (haystack, needle):
00334     l = len(needle) - 1
00335     while l and not haystack.endswith(needle[:l]):
00336         l -= 1
00337     return l

Here is the caller graph for this function: