Add assertion passes

Aperta
#2,158 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
compilers

Direzione di ricerca

Start with the linked Implementation Overview, especially the type checker's passes and the semantic analysis phase. The issue has no concrete design or files identified, so first define the assertion boundaries, checks, and expected post-conditions in the discussion. Done means an agreed design and implemented checks that catch invalid pass transitions without cluttering normal code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

priority-2-low refactoring

(Stealing text from #2150)

It would be nice to have "assertion passes" between the different passes, to verify and document the post-conditions of each pass and pre-conditions of the next, without adding more clutter to the code. Examples (due to Jukka):

We could, for example, verify that unbound types don't leak from semantic analysis, and that every name expression refers to something after semantic analysis.

In addition, currently breaking something in e.g. the semantic analysis pass, is likely to result in a seemingly unrelated error message in latter phases. Of course it cannot be completely avoided, but it can be reduced.

I don't have any concrete design in mind. My intention is that the scope, nature, design and other details are to be fleshed out in this thread. The idea is very half-baked, so I'm looking forward for your comments.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python/mypy

Tutte le issue di python/mypy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.