adafruit / Adafruit_CircuitPython_Requests

Requests-like interface for web interfacing
MIT License
51 stars 36 forks source link

using sockets as dict keys #66

Closed dhalbert closed 2 years ago

dhalbert commented 3 years ago

.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: https://github.com/adafruit/circuitpython/issues/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 https://github.com/adafruit/circuitpython/issues/4061 with @hierophect.

tannewt commented 3 years ago

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

dhalbert commented 2 years ago

Fixed by https://github.com/adafruit/circuitpython/pull/4049.