python / python/mypy

mypy doesn't check f-strings conversions

Open
#11,723 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

f"{None:%d/%m/%Y}" # runtime error
f"{'':1f}" # runtime error

https://mypy-play.net/?mypy=latest&python=3.10&gist=a4528c444b265cd524ec3a6f2bce3b10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two examples in the linked mypy-play playground with Python 3.10 and the latest mypy. Trace how mypy handles the f-string conversions, then verify that invalid conversions are diagnosed rather than reaching the shown runtime errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.