Re:Python Anti-Pattern
by valinsky on Wednesday September 15, 2021 @05:46PM
(#28544769)
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
[ Parent
| on HN ]
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