-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pylance reports: Dictionary key must be hashable: Type "int" is not hashable. #723
Comments
Thanks for the report Glen, Jos |
Thanks. Oh and another data point:
I did try adding the |
Correction: Adding def __hash__(self) -> int: ... to the end of This would presumably be also needed for other hashable builtin types like |
I can reproduce this in a configuration without
But rather than just fixing this one - I think it makes sense to update the stdlib stubs to a current version. the issue is that modules such as I'll integrate this into micropython-stubber and let you know when I have updated stub packages to try. |
Could you give these a test : pip install git+https://github.com/josverl/micropython-stubs.git@stdlib-updates#subdirectory=publish/micropython-stdlib-stubs --target typings --no-user
pip install git+https://github.com/josverl/micropython-stubs.git@stdlib-updates#subdirectory=publish/micropython-v1_20_0-esp32-stubs --target typings --no-user there is a warning regarding stdlib that i still need to look into. If I test using my reproduction |
note to self :
|
I have just installed
micropython_esp32_stubs-1.20.0.post2
to use with Pylance and VSCode (version 1.81.1) and this codei = 0; d = {i: "a"}
generates the following problem report from Pylance (version v2023.8.50):A similar error is generated for "str" keys.
I installed with
pip install -U micropython-esp32-stubs --target ~/.micropy/micropython-esp32-stubs --no-user
.My relevant parts of my workspace
settings.json
is:where
~/.micropy/latest
is a symlink to themicropython-esp32-stubs
folder.Oh - and I should add how much I enjoy micropython dev with these micropython stubs - thanks for putting this together.
The text was updated successfully, but these errors were encountered: