When I use pyright under Python 3.14 with a Python file that contains any str, pyright checks the file lib/python3.14/string/templatelib.py and complains about the template strings there because --pythonversion is set to a Python version < 3.14.
Test code a.py:
pyright --pythonversion 3.13 a.py leads to:
/home/torsten/.pyenv/versions/3.14.0/lib/python3.14/string/templatelib.py
/home/torsten/.pyenv/versions/3.14.0/lib/python3.14/string/templatelib.py:3:5 - error: Template string literals (t-strings) require Python 3.14 or newer
/home/torsten/.pyenv/versions/3.14.0/lib/python3.14/string/templatelib.py:5:24 - error: Cannot access attribute "interpolations" for class "str"
Attribute "interpolations" is unknown (reportAttributeAccessIssue)
2 errors, 0 warnings, 0 informations
VS Code extension or command-line
cli
pyright --version
pyright 1.1.406
When I use pyright under Python 3.14 with a Python file that contains any
str, pyright checks the filelib/python3.14/string/templatelib.pyand complains about the template strings there because--pythonversionis set to a Python version < 3.14.Test code
a.py:"hello world"pyright --pythonversion 3.13 a.pyleads to:VS Code extension or command-line
cli