Support for `__builtins__.pyi`?
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
In #12860 @erictraut said:
We decided to support this in pyright through the use of a specially-named builtins.pyi stub file. If a stub with this name is found within the root directory of a project, pyright treats any symbols declared within that stub as though they are appended to the bottom of builtins.pyi.
and @AlexWaygood closed the issue saying:
if anybody wants to request a mypy equivalent of the more limited feature Eric's introduced over at pyright, they can open another issue to do so.
I would like to request a mypy version of this feature, so that custom Python distributions that provide extra builtins can ship type definitions that are understood by mypy. In specific, I am interested in this because PyScript is discussing adding a builtin called display which is like a web aware print and they want to make it a builtin.
https://github.com/pyscript/pyscript/discussions/1687
It's worth pointing out that typescript also has a version of this feature with declare global. Though the JavaScript ecosystem also has a lot of tools that pollute the "builtins"-level scope so they have a much stronger need for this sort of thing.
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
Leggi la documentazione di pyright indicata in docs/builtins.md e confronta il comportamento di builtins.pyi con la gestione esistente di builtins.pyi in mypy. Traccia come viene individuata la radice del progetto e come vengono caricate le definizioni di builtins; il lavoro è completo quando uno stub personalizzato al livello radice contribuisce simboli al controllo dei tipi, con test che coprono questo comportamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100