Closed
Description
Bug description
Since Python 3.12, the same quotes can be used in f-strings as were used for the outer string itself. Pylint correctly points out that inconsistent quote styles have been used if this is not done. However, it does not take into account the configured py-version, so it also warns for Python versions < 3.12 when the test is performed with Python 3.12.
dictionary = {'0': 0}
f_string = f'{dictionary["0"]}'
Configuration
py-version=3.10
Command used
pylint a.py
Pylint output
************* Module a
a.py:2:0: W1405: Quote delimiter " is inconsistent with the rest of the file (inconsistent-quotes)
Expected behavior
As far as I understand it, pylint should only give this warning if the py-version is >= 3.12.
Pylint version
pylint 3.0.0
astroid 3.0.0
Python 3.12.0 (main, Oct 3 2023, 22:08:15) [GCC 13.2.1 20230801]