A way to relax param-spec -- AnyLike
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 1.8k
- Fork
- 302
- Merge medio
- 23h
- PR unite (30g)
- 8
Descrizione
What what i would really like is https://github.com/python/typing/issues/1506
however mapping types is pretty complex and general.
Consider something like Dask's client.submit
submit[T, **P](self, func: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> Future[T]
What it actually wants is any type in the outer arguments can be
either the original type Q, in P.args or P.kwargs, or Future[Q].
But specifying that is a bit fiddly.
A less complex thing would be to introduce a special form AnyLike
which can be run as
submit[T, **P](self, func: Callable[P, T], *args: AnyLike[P].args, **kwargs: AnyLike[P].kwargs) -> Future[T]
which would have the effect of allowing the types in
args to be Any but the number must match that in the paramspec P,
and similar the types in kwargs can be Any but the names must till match those in the paramspec P
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 leggendo typing issue 1506 e l'uso proposto di AnyLike per client.submit di Dask. Definisci la semantica prevista per P.args e P.kwargs, inclusi il numero di argomenti e i nomi delle parole chiave, e considera come la proposta si inserisca nel comportamento esistente di ParamSpec; il lavoro sarà completato quando sarà disponibile una specifica concordata per la nuova special form.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100