[Zodb-checkins] CVS: Zope3/lib/python/Persistence - Class.py:1.10 patch.py:1.5
Jeremy Hylton
jeremy@zope.com
Fri, 22 Nov 2002 11:54:39 -0500
Update of /cvs-repository/Zope3/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv12283
Modified Files:
Class.py patch.py
Log Message:
Make it _p_newstate() instead of __newstate__(),
as suggested by Neil Schemenauer.
=== Zope3/lib/python/Persistence/Class.py 1.9 => 1.10 ===
--- Zope3/lib/python/Persistence/Class.py:1.9 Fri Nov 22 11:35:57 2002
+++ Zope3/lib/python/Persistence/Class.py Fri Nov 22 11:54:38 2002
@@ -307,7 +307,7 @@
def __getnewargs__(cls):
return cls.__name__, cls.__bases__, {}
- def __newstate__(cls, acls):
+ def _p_newstate(cls, acls):
# Update a class's __dict__ in place. Must use setattr and
# delattr because __dict__ is a read-only proxy.
# XXX This doesn't handle __methods__ correctly.
=== Zope3/lib/python/Persistence/patch.py 1.4 => 1.5 ===
--- Zope3/lib/python/Persistence/patch.py:1.4 Fri Nov 22 10:00:30 2002
+++ Zope3/lib/python/Persistence/patch.py Fri Nov 22 11:54:38 2002
@@ -103,11 +103,11 @@
def __call__(self, *args):
new = self.unwrap(*args)
if self._replace is not None:
- # XXX Hack: Use __newstate__ for persistent classes, because
+ # XXX Hack: Use _p_newstatefor persistent classes, because
# a persistent class's persistent state is a fairly limited
# subset of the dict and we really want to replace everything.
- if hasattr(self._replace, "__newstate__"):
- self._replace.__newstate__(new)
+ if hasattr(self._replace, "_p_newstate"):
+ self._replace._p_newstate(new)
else:
self._replace.__setstate__(new.__getstate__())
return self._replace