[2.4 regression] modules imported inside a method of an `ignore_errors` module aren't checked anymore
I maintainer di solito rispondono entro 1 giorno
@bniladridas ci sta già lavorando.
Dal 25/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 63/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- developer-experience, testing
Direzione di ricerca
Start by reproducing the regression with the provided pkg modules and mypy.ini, comparing the reported 2.3.1 and 2.4.0 results. Trace how imports inside methods are handled when the importing module has ignore_errors = True; the issue names no mypy source file or test. Done means mypy still reports the incompatible assignment in pkg/b.py under the 2.4.0 configuration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
pkg/__init__.py:
# -- nothing to see here --
pkg/a.py:
class A:
def f(self) -> None:
import pkg.b
pkg/b.py:
x: int = "moo"
repro.py:
import pkg.a
mypy.ini:
[mypy]
[mypy-pkg.a]
ignore_errors = True
2.3.1
$ uvx --with="mypy==2.3.1" mypy repro.py
pkg/b.py:1: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
Found 1 error in 1 file (checked 1 source file)
2.4.0
$ uvx --with="mypy==2.4.0" mypy repro.py
Success: no issues found in 1 source file
Numba runs stubtest with ignore_errors = True, so after upgrading mypy to 2.4.0 (in numba/numba#10887) this bug caused new failed to find stubs errors for modules that are only imported from within some method. The workaround is to set native_parser = False in the mypy.ini for now.
- Lingua principale
- Python
- Stelle
- 20.7k
- Fork
- 3.3k
- Merge medio
- 1g 16h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python/mypy
-
Regression in 2.4.0: empty constraint tuple in PEP 695 type parameter (`class C[T: ()]`) is no longer reportedForse di nuovo libera @CheerathAniketh l’ha presa 18 giorni fa e non c’è nessuna pull request aperta. Apertatopic-parser topic-pep-695
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
python/mypy#22176 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
matches_gitignore: directory-only patterns in nested .gitignore not excluded under --exclude-gitignoreForse di nuovo libera @pavithraramesh5500-ship-cse l’ha presa 9 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`stubgen --inspect-mode` crashes with `AttributeError on PEP 604 union syntax (X | Y)` *(mypy 2.1.0)*Forse già presa @ayushdoesdev l’ha presa 85 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Inconsistent description of `strict_optional`Forse già presa @Joosboy l’ha presa 102 giorni fa. Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
python/mypy#21658 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Cannot set `output` in `mypy.ini`Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug topic-configuration topic-error-reporting
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
python/mypy#21376 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/agent-lightning#661 ·
I maintainer di solito rispondono entro 2 giorni
-
area/profiles comp/cli P3 type/feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NousResearch/hermes-agent#146372 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] OpenAI-compatible embedding model alias breaks embedder constructionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
GeoSeries scale and skew tests fail with pytest 9.2.0Forse già presa @jiayuasu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno