Skip to content

Should socketserver.BaseServer have abstract methods? #127209

@tungol

Description

@tungol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions