There is a difference when __eq__ is called and not called in python 2.7 and 3.4. In python 3.4, when an object is compared to something else, e.g. obj != None, the __eq__ is called to do the comparison, whereas in python 2.7, it does not. The following patch allows ComparableVersionedObject to be used in python 3.4 by checking if the object has obj_to_primitive() as an attribute. Change-Id: I9b989bb07505842651bc73c2ccc1552b14307a68 Closes-Bug: #1469864
oslo.versionedobjects
The oslo.versionedobjects library provides a generic versioned object model that is RPC-friendly, with inbuilt serialization, field typing, and remotable method calls. It can be used to define a data model within a project independent of external APIs or database schema for the purposes of providing upgrade compatibility across distributed services.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/oslo.versionedobjects
- Source: http://git.openstack.org/cgit/openstack/oslo.versionedobjects
- Bugs: http://bugs.launchpad.net/oslo.versionedobjects
Description
Languages
Python
100%