Can't use a subscripted `ThingSlot`
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by reading the ThingSlot and BaseDescriptor definitions and the code that handles __orig_class__; the issue identifies the mismatch between the one-parameter subscription and the descriptor’s two type parameters. Check existing tests for thing_slot() and descriptor typing behavior. Done means ThingSlot[MyOtherThing]() works as expected or the supported behavior is documented clearly.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The public API says I should define a Thing Slot like:
class MyThing(lt.Thing):
other_thing: MyOtherThing = lt.thing_slot()
This works fine.
I expected I could also do this:
class MyThing(lt.Thing):
other_thing = ThingSlot[MyOtherThing]()
The second form (which isn't recommended anywhere) does not work. The reason for this is that BaseDescriptor expects two type parameters, the first is the host class and the second is the value. When it calls __orig_class__, it gets ThingSlot[ValueType] and not BaseDescriptor[lt.Thing, ValueType].
To Reproduce
Define a ThingSlot using the type in a subscript, as shown above.
Expected behaviour
I hoped the two examples above would be equivalent.
Additional context
The subscripted form is not really used or recommended anywhere. We could just remove it - but I feel like it has its uses. This isn't blocking anything, so it's likely to sit in the backlog for a little while.
- Lingua principale
- Python
- Stelle
- 10
- Fork
- 4
- Merge medio
- 4g 15h
- PR unite (30g)
- 11
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 labthings/labthings-fastapi
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
labthings/labthings-fastapi#438 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
labthings/labthings-fastapi#435 ·
I maintainer di solito rispondono entro 3 giorni
-
Consider atomic JSON writesForse di nuovo libera @ashiishe2-oss l’ha presa 26 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
labthings/labthings-fastapi#412 · 3 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Use `Exception.add_note`Apertadrop-python-version
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
labthings/labthings-fastapi#354 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Log propagation issueAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
labthings/labthings-fastapi#312 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di labthings/labthings-fastapi
Issue simili
-
bug feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Qiskit/qiskit-obp#156 ·
-
perf(batch-jobs): discover-misses reads the state list without running the whole stage reportApertaaction-item enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
getcommunityone/open-navigator#1658 ·
I maintainer di solito rispondono entro 1 giorno
-
review-panel severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kristovatlas/coin-accounting#636 ·
I maintainer di solito rispondono entro 1 giorno