Re:WTFPython – Understanding Python through surprising snippets
by BiteCode_dev on Monday December 23, 2019 @04:27AM
(#21862445)
> I don’t think standard python tooling would catch the above issues,
Of course it does.
$ echo "
> powers_of_x = [lambda x: x^i for i in range(10)]
> [f(2) for f in powers_of_x]
> " > test.py
$ pylint test.py
...
test.py:2:27: W0640: Cell variable i defined in loop (cell-var-from-loop)
...
Pylint is the most powerful linter for Python is well integrated in VSCode or PyCharm.
When concerns are raised about JS, people are quick to answer you are not supposed to use it without modern tooling (Webpack + babel + typescript + eslint + lowdash...), although many devs still do.
Now, I use and teach a lot of JS, and I enjoy many of its modern features. I especially like the object destructuring, it's even better than Python's unpacking.
But objectively, you can get a very decent experience in Python without any kind of tooling. And yet, there is a lot of it if you want to up your game: pylint, black, mypy, jedi, pytest, poetry, etc.
Of course it does.
Pylint is the most powerful linter for Python is well integrated in VSCode or PyCharm.When concerns are raised about JS, people are quick to answer you are not supposed to use it without modern tooling (Webpack + babel + typescript + eslint + lowdash...), although many devs still do.
Now, I use and teach a lot of JS, and I enjoy many of its modern features. I especially like the object destructuring, it's even better than Python's unpacking.
But objectively, you can get a very decent experience in Python without any kind of tooling. And yet, there is a lot of it if you want to up your game: pylint, black, mypy, jedi, pytest, poetry, etc.