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

Added simple equality operator for class Symbol #55

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

GregoirePelegrin
Copy link

Following on my issue regarding the implementation of the equality operator, I did just that.
This now allows equality comparison between two Symbol instances and returns True if their label attributes are equal.

@eduard-sukharev
Copy link

I face the same issue with syntax='explicit' and attempting to json.dumps the diff and this should fix it.

@fzumstein fzumstein merged commit 9e82d07 into xlwings:master Feb 13, 2023
@fzumstein
Copy link
Member

thx and sorry for slow motion.

corytodd pushed a commit to corytodd/jsondiff that referenced this pull request Jun 2, 2023
In xlwings#55 an equality method was introduced without a corresponding hash
method. Hashable objects that implement __eq__ must also implement
__hash__ if the type is immutable [1]. Implement hash using the label
field which is now a property in order to convey the intent of
immutability.

Fixes xlwings#58

[1] https://docs.python.org/3/reference/datamodel.html#object.__hash__

Signed-off-by: Cory Todd <cory.todd@canonical.com>
This was referenced Jun 2, 2023
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

Successfully merging this pull request may close these issues.

3 participants