How to use the persistent._compat.copy_reg function in persistent

To help you get started, we’ve selected a few persistent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zopefoundation / persistent / persistent / persistence.py View on Github external
def _slotnames(self, _v_exclude=True):
        slotnames = copy_reg._slotnames(type(self))
        return [x for x in slotnames
                   if not x.startswith('_p_') and
                      not (x.startswith('_v_') and _v_exclude) and
                      not x.startswith('_Persistent__') and
                      x not in _SLOTS]
github zopefoundation / persistent / persistent / persistence.py View on Github external
def __reduce__(self):
        """ See IPersistent.
        """
        gna = getattr(self, '__getnewargs__', lambda: ())
        return (copy_reg.__newobj__,
                (type(self),) + gna(), self.__getstate__())