[sqlalchemy] mutable extension problems sa-0.7.9

2012-12-04 Thread Dmitry Bogun
I have tried to create some custom SA type. And got in situation when I can't find correct wayout. Minimal test case in attach. My app have class SiteVersion, it can be used as regular object and as SA mmaped object. When I use only SiteVesionDeco(see attach) all works fine, except propagating

Re: [sqlalchemy] mutable extension problems sa-0.7.9

2012-12-04 Thread Michael Bayer
this is an incorrect __eq__() method: def __eq__(self, other): if not isinstance(other, SiteVersion): raise NotImplementedError('Expect %s instance, got %s' % (SiteVersion, other)) suppose I have a custom object Foo: class Foo(object): def __eq__(self, other):

Re: [sqlalchemy] mutable extension problems sa-0.7.9

2012-12-04 Thread Dmitry Bogun
Sorry, my fault. I was not enough attentive while read this http://docs.python.org/2.7/reference/datamodel.html?highlight=__eq__#object.__eq__ part of documentation. I somehow thought that comparison method must wait NotImplementedError in case of impassible comparison. But now, when you