(ob_type, pickle_function, constructor_ob=None)
| 10 | dispatch_table = {} |
| 11 | |
| 12 | def pickle(ob_type, pickle_function, constructor_ob=None): |
| 13 | if not callable(pickle_function): |
| 14 | raise TypeError("reduction functions must be callable") |
| 15 | dispatch_table[ob_type] = pickle_function |
| 16 | |
| 17 | # The constructor_ob function is a vestige of safe for unpickling. |
| 18 | # There is no reason for the caller to pass it anymore. |
| 19 | if constructor_ob is not None: |
| 20 | constructor(constructor_ob) |
| 21 | |
| 22 | def constructor(object): |
| 23 | if not callable(object): |
no test coverage detected
searching dependent graphs…