Type annotation for attr.ib wrappers functions
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- developer-experience
Direzione di ricerca
Reproduce the example with mypy 0.812, Python 3.7.3, and attrs 20.3.0, focusing on the unexpected keyword argument for the wrapped attribute. Then inspect the attrs typing integration and determine what support is needed; done means the example type-checks without the acme error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It's possible to type a method that wraps an attr.ib attribute?
Example:
import attr
from typing import Any
def typed() -> Any:
return attr.ib(type=str)
@attr.s
class TestingParams:
foo = attr.ib(type=str)
acme = typed()
TestingParams(foo='1', acme='3')
Executing mypy (0.812) with Python (3.7.3) and attrs (20.3.0) I got the following output
error: Unexpected keyword argument "acme" for "TestingParams" [call-arg]
- Lingua principale
- Python
- Stelle
- 5.8k
- Fork
- 480
- Merge medio
- 2h 15m
- PR unite (30g)
- 2
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.
Altre issue di python-attrs/attrs
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
python-attrs/attrs#1620 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
python-attrs/attrs#1596 · 2 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
python-attrs/attrs#1549 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
python-attrs/attrs#1543 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
python-attrs/attrs#1532 ·
Tutte le issue di python-attrs/attrs
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·