Python-Dateien

Neu laden
Gefunden: 162 Datei(en)
copyreg.py
# Source Generated with Decompyle++
# File: copyreg.pyc (Python 3.13)

__all__ = [
    'pickle',
    'constructor',
    'add_extension',
    'remove_extension',
    'clear_extension_cache']
dispatch_table = { }

def pickle(ob_type, pickle_function, constructor_ob = (None,)):
    if not callable(pickle_function):
        raise TypeError('reduction functions must be callable')
    dispatch_table[ob_type] = None
    constructor(constructor_ob)
    return None


def constructor(object):
    if not callable(object):
        raise TypeError('constructors must be callable')

complex

def pickle_complex(c):
    return (complex, (c.real, c.imag))

pickle(complex, pickle_complex, complex)