Closed asltpo closed 11 months ago
Having the same issues.
doing this fixes it: Adding
def __hash__(self) -> int: ...
to the end of class int (and class str) in stdlib -> builtins.pyi removed the warnings from pylance.
https://github.com/Josverl/micropython-stubs/issues/723#issuecomment-1703723773
Same Pylance behaviour to me. False positive. "Dictionary key must be hashable..."
New to uPy, but I'm glad I found this - updating the stdlib buildints.pyi fixed it for now but I'll have to do that for any class I want to use as a dictionary key to avoid squiggles.
Just adding my $0.02 to request a please fix!
Expect a fix in the next few hours...
@Snipeye @asltpo does https://github.com/paulober/MicroPico/releases/tag/v3.4.0 fix your issues? (it's only MicroPython v1.20.0 but v1.21.0 will follow in the next few days)
After updating I no longer see the squiggles, and my builtins.pyi was updated. (That is to say: I don't think it was just a holdover from my kludges last night). Thanks, @paulober !
Ditto, if I follow the steps from my original post but using:
VSCode v1.83.1 Pylance v2023.10.30 MicroPico v3.4.0
I get the correct behaviour.
Many thanks!
Describe the bug Steps:
Expected behaviour: No warnings or errors.
Actual behaviour: Pylance reports the following error:
Notes:
The expected behaviour is restored if:
Code or Screenshots
Python code:
my_dict = {"key1": 1}
Version info VSCode v1.82.2 Pylance v2023.9.20 MicroPico v3.2.5