Skip to content

PYTHON-2466 Make pymongo client, database and collection objects hashable. #533

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

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

pcorpet
Copy link
Contributor

@pcorpet pcorpet commented Dec 14, 2020

…able.

@pooooodles pooooodles added the tracked-in-jira Ticket filed in Mongo's Jira system label Dec 14, 2020
Copy link
Contributor

@prashantmital prashantmital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in the future we might want to consider adding some configuration information to the __eq__ and __hash__ methods for these classes - the present implementation will result in two DBs with different readPreferences, for example, to hash to the same value.
For the time being, this implementation LGTM since __hash__ must be the same for values that compare equal using __eq__.

@prashantmital prashantmital merged commit 733ab25 into mongodb:master Dec 17, 2020
@prashantmital
Copy link
Contributor

Thank you for your contribution @pcorpet !

prashantmital pushed a commit that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked-in-jira Ticket filed in Mongo's Jira system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants