Skip to content

Python 3 HTTPConnection stubs missing class variables #1901

@scottbelden

Description

@scottbelden

The python 2 stubs have the class variables:

class HTTPConnection:
response_class = ... # type: Any
default_port = ... # type: Any
auto_open = ... # type: Any
debuglevel = ... # type: Any
strict = ... # type: Any
timeout = ... # type: Any
source_address = ... # type: Any
sock = ... # type: Any

but the python 3 stubs do not:

class HTTPConnection:
if sys.version_info >= (3, 4):
def __init__(
self,
host: str, port: Optional[int] = ...,
timeout: int = ...,
source_address: Optional[Tuple[str, int]] = ...
) -> None: ...
else:
def __init__(
self,
host: str, port: Optional[int] = ...,
strict: bool = ..., timeout: int = ...,
source_address: Optional[Tuple[str, int]] = ...
)-> None: ...

This causes a mypy error with the following:

error: "Type[HTTPConnection]" has no attribute "debuglevel"

If all that needs to be done is to add the hints for those class variables, then I don't mind making a PR to do so.

Please let me know if I should make the PR or if I have the error wrong and the problem is somewhere else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions