On Dec 11, 2008, at 5:50 AM, Jonathan Marshall wrote:
> > The problem seems to be the assumption that copies of an object > produce identical pickles. Perhaps a better solution may be for > compare_values to use __eq__ by default if it exists otherwise compare > __dict__? comparing __dict__ is pretty involved and would mean we'd have to dig down arbitrarily deep into the object tree. It would be like reimplementing pickle, really. I'd rather just make __eq__() mandatory for the usage of PickleType when mutable=True. > Also I don't agree that the current desired behaviour is documented. > See http://www.sqlalchemy.org/docs/05/types.html#types_standard_pickletype > and > http://www.sqlalchemy.org/docs/05/sqlalchemy_types.html#docstrings_sqlalchemy.types_PickleType OK, thats a bug in the configuration of our new sphinx doc generator. Here is the docstring for PickleType: """Holds Python objects. PickleType builds upon the Binary type to apply Python's ``pickle.dumps()`` to incoming objects, and ``pickle.loads()`` on the way out, allowing any pickleable Python object to be stored as a serialized binary field. """ """ Construct a PickleType. :param protocol: defaults to ``pickle.HIGHEST_PROTOCOL``. :param pickler: defaults to cPickle.pickle or pickle.pickle if cPickle is not available. May be any object with pickle-compatible ``dumps` and ``loads`` methods. :param mutable: defaults to True; implements :meth:`AbstractType.is_mutable`. :param comparator: optional. a 2-arg callable predicate used to compare values of this type. Defaults to equality if *mutable* is False or ``pickler.dumps()`` equality if *mutable* is True. """ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---