`__getattr__` in child class gets called when mixed with `cached_property`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by running the Python reproduction from the issue with attrs and functools.cached_property. Trace how the inherited cached_property is resolved when Sup defines getattr, then add a regression test for b.howdy. Done means the existing cached property is returned without calling Sup.getattr.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
from functools import cached_property
from attrs import define
@define
class Bob:
@cached_property
def howdy(self):
return 3
class Sup(Bob):
def __getattr__(self, name):
raise AttributeError(name)
b = Sup()
# reaches __getattr__ where I raise AttributeError
b.howdy
This previously did not error. I would expect __getattr__ to not be called since the attribute exists.
- 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
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·