Hello!
On Mon, May 29, 2006 at 10:26:49PM +0300, Dan Pascu wrote:
> def __init__(self, instance):
> - self.instance = instance
> + self.instance = weakref.proxy(instance)
>
> def setClass(cls, soClass):
> cls.soClass = soClass
> @@ -1501,7 +1502,7 @@
> class SQLObjectState(object):
>
> def __init__(self, soObject):
> - self.soObject = soObject
> + self.soObject = weakref.proxy(soObject)
> self.protocol = 'sql'
The patch breaks test_cache.py:
def test_cache():
setupClass(CacheTest)
s = CacheTest(name='foo')
obj_id = id(s)
s_id = s.id
assert CacheTest.get(s_id) is s
assert not s.sqlmeta.expired
CacheTest.sqlmeta.expireAll()
assert s.sqlmeta.expired
del s
CacheTest.sqlmeta.expireAll()
s = CacheTest.get(s_id)
# We should have a new object:
E assert id(s) != obj_id
> assert -1219232756 != -1219232756
+ where -1219232756 = id(<CacheTest 1 name='foo'>)
Please investigate if this can be fixed.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss