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
hashable and mutable functions #42395
Comments
It is not easy to check if an object is hashable, ie try: hash(list()) seems to be a possible way to see if an object is My proposal: Reason: |
Logged In: YES
Why?
How should "ismutable" be implemented?
It's easier to ask for forgiveness than permission. Even callable() has been called a mistake. Just call So, -1. |
Logged In: YES def ishashable(ob):
try:
hash(ob)
return True
except TypeError:
return False is the only reasonable way to implement this function (incidentally, do you I don't see the need for a builtin, but am not feeling bolshy enough to just |
Logged In: YES Adding a third -1 from me and closing the RFE. |
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: