I've a python project using PyDev in Eclipse. For sample code like below,
var = 'element'
width = 11
print(f'{var:>{width}}')
the code is executed printing the desired output element
with right alignment and no errors.
However, PyDev parses this code raising error at >
character and an error message SyntaxError: Unbalanced '{'
. But PyDev does support double braces in f-strings since release 6.3.1 (#PyDev-884). If I remove this >
character, the string is printed 'left-aligned' (which I don't want) and PyDev doesn't raise any error. This confirms PyDev does support double braces, but the error message is incorrect.
On the other hand, PEP 498 for f-strings doesn't mention anything about alignment using f-strings. Is alignment part of the f-string syntax? If it is why is it not mentioned in PEP guide, and why does PyDev parser raise an error?
- Python: 3.6.3
- PyDev: 6.3.3
- Eclipse: Oxygen.2 (4.7.2)
Thanks!