Re:Python Anti-Pattern
by davidatbu on Wednesday September 15, 2021 @05:16AM
(#28536947)
Shout out to the amazing Pyright, the fast and feature-complete python LSP that you can use with any editor that supports the LSP protocol!
[ Parent
| on HN ]
I'm using VSCode with different Python specific extensions, like Pylance which uses Pyright, but it didn't warn me about the mutable function parameter. RIP
Re:Python Anti-Pattern
by EdwardDiego on Wednesday September 15, 2021 @11:56PM
(#28547811)
Huh, that sucks. I use Intellij Ultimate for pretty much everything, and it (and the Python focused Pycharm) will definitely warn on this particular Python quirk.
You're right, I checked, and pyright only warns about function calls in default arguments, not mutable containers.
I started a discussion in Pyright's repo here[0].
Thanks to the maintainer's great responsiveness, Pyright will implement such a warning soon: https://github.com/microsoft/pyright/issues/2308