zopefoundation / persistent

automatic persistence for Python objects
https://pypi.org/project/persistent/
Other
46 stars 28 forks source link

Pure python Persistent does not call jar.register() without _p_oid but c-implementation does #28

Closed tonich-sh closed 6 years ago

tonich-sh commented 9 years ago
from persistent import Persistent

class A(Persistent):
    name = None

class Jar(object):
    r = 0
    def register(self, obj):
        self.r += 1

j = Jar()

a = A()
a._p_jar = j

a.name = 'test'

print j.r

prints "0" when runs with PURE_PYTHON=1 and "1" - without.

jamadden commented 6 years ago

See comments in #29 about closing this issue.