Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No easy way to compare two objects #136

Open
maxandron opened this issue Feb 8, 2017 · 0 comments
Open

No easy way to compare two objects #136

maxandron opened this issue Feb 8, 2017 · 0 comments

Comments

@maxandron
Copy link

Hi,

It's more of a feature request than a bug, basically you can't compare two JsonObjects

For example:

class Foo(JsonObject):
     bar = StringProperty()     
a = Foo(bar="wow")
b = Foo(bar="wow")

>>> a == b
>>> False

I don't mind pushing a pull request if you agree that this would be a useful design for the library
Thanks,
Ron.

P.S.:
Currently I compare like this:
json.dumps(a.to_json(), sort_keys=True) == json.dumps(b.to_json(), sort_keys=True)

@maxandron maxandron changed the title No easy way to compare object No easy way to compare two objects Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant