Fine-grained: Inconsistent behavior for nested NewType
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with the fine-grained incremental mode test case testRefreshNestedNewType and run it through both increments described for a.py and b.py. Compare the first and second outputs for the nested NewType declarations; done means both runs produce identical errors for each example.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The output of the second increment of this fine-grained incremental mode test case doesn't generate an error, even though nothing relevant has changed:
[case testRefreshNestedNewType]
import a
[file a.py]
from typing import Union, NewType
import b
def f(self) -> None:
X = NewType('X', A)
A = str
[file b.py]
y = 0
[file b.py.2]
y = ''
[out]
Here's the output:
a.py:5: error: Argument 2 to NewType(...) must be subclassable (got A?)
==
The expected output would be identical for both runs.
The output from the first and second runs also does not match for this slightly different test case:
[case testRefreshNestedNewType]
import a
[file a.py]
from typing import Union, NewType
import b
def f(self) -> None:
X = NewType('X', A)
A = Union[int, str]
[file b.py]
y = 0
[file b.py.2]
y = ''
[out]
Here's the output (again expected to be identical):
a.py:5: error: Argument 2 to NewType(...) must be subclassable (got A?)
==
a.py:5: error: Argument 2 to NewType(...) must be subclassable (got "Union[int, str]")
It looks like forward references within NewType declarations behave inconsistently.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Merge medio
- 1g 18h
- PR unite (30g)
- 54
Guida per i contributori
Apri 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
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug topic-configuration topic-error-reporting
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Issue simili
-
link-check link-check:sphinx-theme
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100