Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove _NNTPBase from nntplib #7251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions 39 stdlib/nntplib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ssl
import sys
from _typeshed import Self
from typing import IO, Any, Iterable, NamedTuple, Union
from typing_extensions import Literal

_File = Union[IO[bytes], bytes, str, None]

Expand All @@ -16,8 +17,8 @@ class NNTPPermanentError(NNTPError): ...
class NNTPProtocolError(NNTPError): ...
class NNTPDataError(NNTPError): ...

NNTP_PORT: int
NNTP_SSL_PORT: int
NNTP_PORT: Literal[119]
NNTP_SSL_PORT: Literal[563]

class GroupInfo(NamedTuple):
group: str
Expand All @@ -34,11 +35,13 @@ def decode_header(header_str: str) -> str: ...

_list = list # conflicts with a method named "list"

class _NNTPBase:
class NNTP:
encoding: str
errors: str

host: str
port: int
sock: socket.socket
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
file: IO[bytes]
debugging: int
welcome: str
Expand All @@ -47,7 +50,16 @@ class _NNTPBase:
authenticated: bool
nntp_implementation: str
nntp_version: int
def __init__(self, file: IO[bytes], host: str, readermode: bool | None = ..., timeout: float = ...) -> None: ...
def __init__(
self,
host: str,
port: int = ...,
user: str | None = ...,
password: str | None = ...,
readermode: bool | None = ...,
usenetrc: bool = ...,
timeout: float = ...,
) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
def getwelcome(self) -> str: ...
Expand Down Expand Up @@ -85,22 +97,9 @@ class _NNTPBase:
def login(self, user: str | None = ..., password: str | None = ..., usenetrc: bool = ...) -> None: ...
def starttls(self, context: ssl.SSLContext | None = ...) -> None: ...

class NNTP(_NNTPBase):
port: int
sock: socket.socket
def __init__(
self,
host: str,
port: int = ...,
user: str | None = ...,
password: str | None = ...,
readermode: bool | None = ...,
usenetrc: bool = ...,
timeout: float = ...,
) -> None: ...

class NNTP_SSL(_NNTPBase):
sock: socket.socket
class NNTP_SSL(NNTP):
ssl_context: ssl.SSLContext | None
sock: ssl.SSLSocket
def __init__(
self,
host: str,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.