4 ms·
> But for f-strings, it has full support for the "inline" variables. Is this complete (meaning: it also includes more complicated expressions, referencing thes
by mbeex 6y ago
> But for f-strings, it has full support for the "inline" variables.
Is this complete (meaning: it also includes more complicated expressions, referencing these variables)?
I'm asking, because some Python development tools are failing in doing it right. This leads to annoying reliability issues for refactorings (even for simple renames). Currently, I have the problem with Wing IDE.
- zo1 6y agoAs far as I know yes. It knows that the "usage" of that variable in an f-string is an actual reference to the variable vs just part of the string with the same set of characters. Not sure what you mean by complicated expressions? If you mean the variable is referenced in a complicated statement with calcs or as part of a ternary operator, etc... AFAIK they are all supported. It even understands scope. So it won't go outside of the current scope where the variable is defined. PyCharm's refactoring is very neat. In certain instances it even "refactors" relative paths inside a string if you move the file being referenced. Moving files around is intelligent and all imports get fixed. It has neat naming-convention renaming (myVariable->my_variable). Lots of nice little quality-of-life features, which is why I think it is the best Python IDE out there atm. Give it a whirl, it's got a free community edition that is near 100% functional!
- mbeex 6y agoI tried it (again). First impression: No support for the black formatter. We have 2021 - really? https://youtrack.jetbrains.com/issue/PY-39750 https://youtrack.jetbrains.com/issue/PY-39750
- zo1 6y agoBlack is hardly the industry-wide standard, so I don't see why they would embed it into their IDE? Either way, the IDE has all the sufficient tools to enable me to easily call the black formatter along with pylint, pep8, flake8 and mypy. I have all of them setup in my IDE and trigger them with a right click command, a shortcut button, or automatically on save (if I wanted to). https://www.jetbrains.com/help/pycharm/configuring-third-party-tools.html https://www.jetbrains.com/help/pycharm/configuring-third-par...