Can't use a subscripted `ThingSlot`
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 10
- Forks
- 4
- Merge medio
- 4 d 15 h
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de labthings/labthings-fastapi
-
Tests can fail on `anyio < 4.14`Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
labthings/labthings-fastapi#438 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
labthings/labthings-fastapi#435 ·
Los mantenedores suelen responder en 3 días
-
Consider atomic JSON writesQuizá libre de nuevo @ashiishe2-oss la tomó hace 26 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
labthings/labthings-fastapi#412 · 3 comentarios ·
Los mantenedores suelen responder en 3 días
-
Use `Exception.add_note`Abiertodrop-python-version
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
labthings/labthings-fastapi#354 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
Log propagation issueAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
labthings/labthings-fastapi#312 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de labthings/labthings-fastapi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
bad-antics/lateralus-lang#1623 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
fossguild/thelifesnake#82 ·
Los mantenedores suelen responder en 1 día
-
Unfitted DialectClassifier crashes with a confusing ValueError: raise a clear "not fitted" errorAbiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
omarelshamy25x/shamy-arabic-nlp#111 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pietbarber/Manage2Soar#1189 ·
Los mantenedores suelen responder en 1 día
-
BUG: write_netcdf fails on Tutorial 3 BEM output with pandas CategoricalDtype DOF coordinatesPosiblemente ocupada @dtgaebe la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
sandialabs/WecOptTool#467 ·