Add support for marking classes `typing.final`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- developer-experience
Direzione di ricerca
Start by reviewing the public frozen, define, and mutable decorator APIs and the question of how they should interact with typing.final. The issue leaves defaults, backward compatibility, subclassing behavior, and deprecation options unresolved. Done would require an agreed design before implementation scope can be defined.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am filing the below not really having through details, though I at least don't see this mentioned in any other issue, hence splatting it out :). Spicy takes I'm sure coming below as I'm sure part of this rests on how much each of us tolerates inheritance.
Should attrs have a way to apply typing.final to its classes so that they're easier to mark as "don't subclass"? E.g. a final= argument to frozen / define / mutable?
Obviously stacking the two decorators works, so the motivation I guess for me personally is just "I always want final for basically any class I expose", so if attrs had this it's one less thing to forget. What I do now is usually things at runtime, which don't use final() at all, but given I just realized I should probably add final() too so that users who do rely on their type checkers see a warning, that made me wonder whether that half is something general enough to be here.
If it were an argument to define, defaulting to True obviously breaks backwards compatibility. Perhaps doing it for frozen at least is justifiable? Or at least desirable with a deprecation warning for subclassing in the interim?
Any thoughts on how reasonable that sounds?
- Lingua principale
- Python
- Stelle
- 5.9k
- Fork
- 499
- Merge medio
- 3g 12h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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
-
Docs: `attrs.filters` is missing stated examplesForse già presa @feiiiiii5 l’ha presa 13 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-attrs/attrs#1627 ·
I maintainer di solito rispondono entro 1 giorno
-
slots declared on attrs-decorated class are ignored/lostForse già presa @anshurajbisoyi98-ctrl l’ha presa 5 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
python-attrs/attrs#1637 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
python-attrs/attrs#1620 ·
I maintainer di solito rispondono entro 1 giorno
-
Incorrect annotation for forward reference in generated constructorForse già presa @MohammedAnasNathani l’ha presa 69 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
python-attrs/attrs#1596 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Decorated functions do not work with inheritanceForse già presa @sb123sb123 l’ha presa 16 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
python-attrs/attrs#1549 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di python-attrs/attrs
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rpm-software-management/mock#1824 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
jpata/particleflow#520 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue hacktoberfest
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
gridhead/gi-loadouts#699 ·
I maintainer di solito rispondono entro 13 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
FinanceFlash/unvibecode#206 ·
I maintainer di solito rispondono entro 1 giorno