blob: 209eab501d918500c99fed5cebc1f904953733f3 [file] [log] [blame]
Guido van Rossum47065621997-04-09 17:44:11 +00001dispatch_table = {}
2safe_constructors = {}
3
4def pickle(ob_type, pickle_function, constructor_ob = None):
5 dispatch_table[ob_type] = pickle_function
6
7 if (constructor_ob is not None):
8 constructor(constructor_ob)
9
10def constructor(object):
11 safe_constructors[object] = 1
12
13def pickle_complex(c):
14 return complex,(c.real, c.imag)
15
16pickle(type(1j),pickle_complex,complex)
17