Skip to content

using sockets as dict keys #66

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

Closed
dhalbert opened this issue Jan 30, 2021 · 2 comments
Closed

using sockets as dict keys #66

dhalbert opened this issue Jan 30, 2021 · 2 comments

Comments

@dhalbert
Copy link
Contributor

.socket_free is a dict that uses a socket as a key. To enable this, __hash__() was added to the native Socket class. However, the hash value used is not immutable: adafruit/circuitpython#4101.

The hash function could be fixed, or perhaps the use of a dict that needs to use sockets as a key could be revisited here.

Encountered while debugging adafruit/circuitpython#4061 with @hierophect.

@tannewt
Copy link
Member

tannewt commented Feb 1, 2021

I think the socket fix is the correct one. Sockets should work as keys.

@dhalbert
Copy link
Contributor Author

Fixed by adafruit/circuitpython#4049.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants