Daemon does not progate change from decorated to async function
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
This fine-grained incremental test case fails (no error on second run):
[case testDecoratedToAsyncReExported]
from mm import f
x: int = f()
[file mm.py]
from m import f
[file m.py]
from d import singleton
@singleton
def f() -> int:
return 0
[file m.py.2]
async def f() -> str:
return 'x'
[file d.py]
from typing import Callable
class Singleton:
def __call__(self) -> int:
return 0
def singleton(f: Callable[[], int]) -> Singleton: pass
[out]
==
main:2: error: Incompatible types in assignment (expression has type "Coroutine[Any, Any, str]", variable has type "int")
It seems necessary to have a re-export, a decorator, and an async function for this to work. Also changing the return type of the functions seems required. I have no idea so far why this corner case fails.
This fails in 0.971 so it's not a recent regression.
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.
Direzione di ricerca
Riproduci il caso testDecoratedToAsyncReExported nel test harness incrementale a grana fine, usando gli snapshot indicati di mm.py, m.py e d.py. Traccia il motivo per cui la seconda esecuzione non produce alcun errore; il lavoro è completato quando la seconda esecuzione segnala la diagnostica incompatible-types mostrata senza causare regressioni nei test incrementali correlati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100