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

__eq__ for Pet, Team, Shop, Player #15

Open
alexdriedger opened this issue Feb 1, 2022 · 1 comment
Open

__eq__ for Pet, Team, Shop, Player #15

alexdriedger opened this issue Feb 1, 2022 · 1 comment

Comments

@alexdriedger
Copy link
Contributor

alexdriedger commented Feb 1, 2022

The compress / decompress methods provide good ways to check for equality. However, in situations where the objects do not need to be compressed (eg. unit tests), equality methods are an easier way to check for equality. Additionally, this allows == to be used on these objects, which is probably more accessible to newer developers using the library

@manny405
Copy link
Owner

manny405 commented Feb 2, 2022

This depends on the exact definition of equality. In the current code base, there are many checks for equality which are only seeing if two objects are actually the same object (meaning that they making the same memory reference).

If equality of the health, stats, status, etc. is desired, would it be possible to check if their string representations are identical?

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

2 participants