You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bpo-18510: dict.contains and dict.keys().contains raises exception instead of returning False
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-10-25.16:15:27.466>created_at=<Date2021-10-25.15:22:39.835>labels= ['library', '3.11']
title='Return False from __contains__ method if object not hashable for set and dict'updated_at=<Date2021-10-25.16:15:27.464>user='https://github.com/heckad'
Now if do something like [] in set() python raise an exception, but if an object isn't hashable then we know for sure that it isn't in the set. Propose return False for these cases.
I don't have any code that would care, but if there's one thing I've learned in 15 years of python core development, it's that this will break someone's code.
If you want more feedback, you should probably bring this up for discussion on the python-ideas mailing list.
This is a duplicate of bpo-18510. It was also discussed on the Python-Dev mailing list (maybe more than once). If you have some new arguments or something in past 8 years made the old arguments no longer valid please open a new discussion on the mailing list.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: