Should `socketserver.BaseServer` have abstract methods?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 36k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Feature or enhancement
Proposal:
socketserver.BaseServer is documented to have the methods fileno, get_request, and server_bind, but it doesn't actually have these. They're implemented on the subclass TCPServer instead, and TCPServer is the only direct subclass of BaseServer in the standard library. Of the three methods, get_request is the only one called within any existing methods of BaseServer.
This seems like a situation where BaseServer is acting as an ABC with these methods expected to be implemented by any subclass. Abstract methods weren't available yet when socketserver was added. Does it make sense to use them now? I couldn't find anyone suggesting this on the issue tracker or on discuss.python.org, so I don't know if this has been considered and rejected before, or never really considered.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
- gh-127976
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.
Línea de trabajo
Comienza con los puntos de entrada socketserver.BaseServer y TCPServer, centrándote en fileno, get_request y server_bind, y en cómo los usa actualmente BaseServer. Revisa el PR enlazado gh-127976 y determina si hacer abstractos estos métodos preserva el contrato documentado de las subclases; se considera terminado cuando se haya alcanzado una decisión documentada con la implementación y validación correspondientes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- networking
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100