-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
SocketPool.Socket.__hash__() is not immutable #4101
Comments
@dhalbert as a follow up to our conversation, just noting that returning |
The only other issue is this: #2687, which I think is not applicable. You could try the fix above, and see how it works. You can can return |
In CPython sockets, |
@dhalbert you mean, keep the hash as returning |
Yes, keep using |
I tried using |
@dhalbert if you mean internal state within the Requests library, I think so, yes. We create a |
@hierophect Can you open the second LWIP socket only when you do the server APIs? |
__hash__()
was added toSocket
so aSocket
could be put in a dict, for use in theadafruit_requests
library. However, the hash used is not immutable, and changes when the socket is closed.The hash returned could be
id()
, to make it immutable.. However, it might be worth looking at whether the use ofSocket
inadafruit_requests
really needs a dictionary. I see two uses:._open_sockets
and._socket_free
. I'll bring this up in an issue in that repo.Tagging @hierophect on this, who was trying to debug #4061, which may be caused by this. (
SSLSocket
has the same hash.)The text was updated successfully, but these errors were encountered: