vermin icon indicating copy to clipboard operation
vermin copied to clipboard

Doesn't catch Python 3.12 f-strings changes

Open me21 opened this issue 1 year ago • 3 comments

Describe the bug Vermin doesn't catch changes introduced in Python 3.12 to f-strings. Specifically, f-string nesting. See https://docs.python.org/3/whatsnew/3.12.html#pep-701-syntactic-formalization-of-f-strings

To Reproduce I had the following line in my source: Paragraph(f'{split_fio_birthdate(visitor['fio'])[0]}', normal_style), (please note single quotes inside f-string as well as enclosing ones).

When I invoked vermin with vermin -v --exclude-regex venv ., it incorrectly marked the file containing that line as !2, 3.9. The actual run attempt on Python 3.11.2 threw the following error: SyntaxError: f-string: unmatched '['.

Expected behavior The file should be marked as !2, 3.12.

Environment (please complete the following information):

  • vermin 1.6.0
  • Python 3.12 on the machine I run vermin on (I think with Python 3.11 that line might trigger syntax error)

me21 avatar May 30 '24 10:05 me21

Ping, any chance vermin catches up with latest Python version? :(

disconnect3d avatar Feb 03 '25 23:02 disconnect3d

Hello there. Sorry for the slow reply. I am currently making support for Python 3.13 in Vermin and fixing other issues, too. It is still undecided about the f-strings as I purposefully use the built-in parser of Python such that the project can remain vanilla Python code. The information needed to do the analysis you request is, unfortunately, thrown away by the parser.

netromdk avatar Sep 25 '25 07:09 netromdk

Version 1.7.0 has been released 🎉

The f-strings case is still not support, unfortunately.

netromdk avatar Oct 10 '25 05:10 netromdk