-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Milestone
Description
Bug description
When passing any format specs to t-strings, an f-string-without-interpolation warning will be filed.
Consider the following snippet:
def f():
pi = 3.14
return t"{pi:.1f}"
The template string line will be flagged by lint as having the f-string-without-interpolation issue.Configuration
Command used
python -m pylint test.pyPylint output
************* Module test
test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:1:0: C0116: Missing function or method docstring (missing-function-docstring)
test.py:3:16: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)Expected behavior
Expected behavior is for no linting error to be raised on format spec provided with template string.
Pylint version
pylint 4.0.2
astroid 4.0.1
Python 3.14.0 (main, Oct 19 2025, 09:04:15) [GCC 13.3.0]OS / Environment
WSL 2: Ubuntu 24.04.1 LTS
Additional dependencies
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation