class BinaryEncoder object def __init__ self self buffer BinaryBuffer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
class BinaryEncoder(object):
def __init__(self):
self.buffer = BinaryBuffer()
def serialize(self, o):
self.buffer.reset()
print "foo"
self.iterencode(o)
return self.buffer.clean_buffer()
def iterencode(self, o):
print "bar"
D:\Work\temp\mmoserv\mmoserv\libs\serialize>python test.py
foo
D:\Work\temp\mmoserv\mmoserv\libs\serialize>