Optionally flag known mypyc compatibility issues in mypy
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
Feature
Mypyc is incompatible in some ways with CPython semantics (mypyc/mypyc#973 is a recent example). Add an optional error code to mypy that detects some of these incompatible features in code even when not using mypyc. We can also explain how to work around the issues in notes, or include links to documentation.
Here are some issues we could flag:
- Overriding methods in subclasses of built-in types such as
intorstrthat mypyc can't use. - Subclassing compiled classes that don't support interpreted subclasses. This would require knowledge of which modules will be compiled.
- Monkey patching native functions or methods. This is usually flagged already by mypy, but we could perhaps detect this in additional cases, add a note about mypyc when relevant, and use a separate error code.
Pitch
Code that isn't compiled with mypyc can trigger incompatible behavior or exceptions when interacting with mypyc-compiled modules, and this is confusing. These messages would make it easier to avoid using things that may cause issues with mypyc, if part of a project is compiled with mypyc.
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
Inizia esaminando l'esempio mypyc#973 e le diagnosi esistenti di mypy per il monkey patching. Definisci l'ambito di un codice di errore opzionale per gli override nelle sottoclassi di tipi built-in, la creazione di sottoclassi di classi compilate e il monkey patching pertinente, incluse eventuali note o link alla documentazione. Il lavoro è completato quando le incompatibilità selezionate vengono rilevate senza richiedere mypyc e il comportamento è coperto da test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100