-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
set[str].discard(str | None) #7121
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
Comments
I agree, though we can't use >>> s = {1, 2}
>>> s.discard([])
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
s.discard([])
TypeError: unhashable type: 'list' |
Would the In [1]: hash(None)
Out[1]: 271809023 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following:
It would be nice if this wasn't a type checker error. Unlike
.remove()
, the.discard()
method does nothing if the item is not in the set, so I don't see a good reason to banNone
values.The text was updated successfully, but these errors were encountered: