Async refactoring: reduce code duplication
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 32/100
Línea de trabajo
Start by reviewing load_by_multiget() and the other methods that perform I/O; the issue does not name specific files or tests. Identify their preparation, API-call, and result-processing steps, and check the relevant type hints. Done means I/O methods signal possible coroutine returns and async refactoring reduces duplicated common logic without generated code.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I do want a library that can be used both with sync and async users, with as little code duplication as possible, and without generated code. Perhaps it was silly, perhaps "async first, autogenerated sync code" is the best solution. Anyway, Claude claimed that the "Sans-IO" design pattern would work well. Problem is that the library absolutely wasn't made Sans-IO in the first place.
We should think throughly on how to make version 4.0 more "sans-io". It's probably worth a separate ticket on "long term sans-io plans".. Right now I'm mostly concerned with "make it possible to use the library in an async way" and "refactor to reduce code duplication", and I think this is the way to go:
- All methods doing I/O should be identified. The type hints should be updated to indicate that those methods may return an async coroutine.
- Methods that first prepares something, then fires off some API call, and then processes the results should be refactored - the common code should not be duplicated. I've dealt with this some places (i.e.
load_by_multiget()) by first doing the preparation, thenif self.is_async_client: return self._async_load_by_multiget(xxx)and finallyself._post_load_by_multiget(xxx)for post-processing.
Is this refactoring sane? Any suggestions on how to do it more properly is welcome.
- Lenguaje dominante
- Python
- Estrellas
- 412
- Forks
- 113
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 43
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 python-caldav/caldav
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
python-caldav/caldav#687 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
python-caldav/caldav#780 ·
Los mantenedores suelen responder en 1 día
-
compatibility refactoring
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
python-caldav/caldav#778 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Support for ical objectsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
python-caldav/caldav#777 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
python-caldav/caldav#774 ·
Los mantenedores suelen responder en 1 día
Todos los issues de python-caldav/caldav
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
jbacalso24/mimry#291 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
eli-alvarado/us-watchlist-alerts#14 ·
Los mantenedores suelen responder en 1 día
-
from-review-extraction python severity:nit
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
LearningCircuit/local-deep-research#7462 ·
Los mantenedores suelen responder en 2 días
-
mermaid_extract.py silently discards single-line state-diagram notes; sequence notes are keptAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cathrynlavery/diagram-design#441 ·
Los mantenedores suelen responder en 2 días
-
[Cleanup] Include the public header in work_split.cppPosiblemente ocupada @blozano-tt la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tenstorrent/tt-metal#60850 ·
Los mantenedores suelen responder en 1 día