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

Commit 90bdda8

Browse filesBrowse files
authored
Remove _NNTPBase from nntplib (#7251)
1 parent 99aedf4 commit 90bdda8
Copy full SHA for 90bdda8

File tree

Expand file treeCollapse file tree

1 file changed

+19
-20
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-20
lines changed

‎stdlib/nntplib.pyi

Copy file name to clipboardExpand all lines: stdlib/nntplib.pyi
+19-20Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ssl
44
import sys
55
from _typeshed import Self
66
from typing import IO, Any, Iterable, NamedTuple, Union
7+
from typing_extensions import Literal
78

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

@@ -16,8 +17,8 @@ class NNTPPermanentError(NNTPError): ...
1617
class NNTPProtocolError(NNTPError): ...
1718
class NNTPDataError(NNTPError): ...
1819

19-
NNTP_PORT: int
20-
NNTP_SSL_PORT: int
20+
NNTP_PORT: Literal[119]
21+
NNTP_SSL_PORT: Literal[563]
2122

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

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

37-
class _NNTPBase:
38+
class NNTP:
3839
encoding: str
3940
errors: str
4041

4142
host: str
43+
port: int
44+
sock: socket.socket
4245
file: IO[bytes]
4346
debugging: int
4447
welcome: str
@@ -47,7 +50,16 @@ class _NNTPBase:
4750
authenticated: bool
4851
nntp_implementation: str
4952
nntp_version: int
50-
def __init__(self, file: IO[bytes], host: str, readermode: bool | None = ..., timeout: float = ...) -> None: ...
53+
def __init__(
54+
self,
55+
host: str,
56+
port: int = ...,
57+
user: str | None = ...,
58+
password: str | None = ...,
59+
readermode: bool | None = ...,
60+
usenetrc: bool = ...,
61+
timeout: float = ...,
62+
) -> None: ...
5163
def __enter__(self: Self) -> Self: ...
5264
def __exit__(self, *args: Any) -> None: ...
5365
def getwelcome(self) -> str: ...
@@ -85,22 +97,9 @@ class _NNTPBase:
8597
def login(self, user: str | None = ..., password: str | None = ..., usenetrc: bool = ...) -> None: ...
8698
def starttls(self, context: ssl.SSLContext | None = ...) -> None: ...
8799

88-
class NNTP(_NNTPBase):
89-
port: int
90-
sock: socket.socket
91-
def __init__(
92-
self,
93-
host: str,
94-
port: int = ...,
95-
user: str | None = ...,
96-
password: str | None = ...,
97-
readermode: bool | None = ...,
98-
usenetrc: bool = ...,
99-
timeout: float = ...,
100-
) -> None: ...
101-
102-
class NNTP_SSL(_NNTPBase):
103-
sock: socket.socket
100+
class NNTP_SSL(NNTP):
101+
ssl_context: ssl.SSLContext | None
102+
sock: ssl.SSLSocket
104103
def __init__(
105104
self,
106105
host: str,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.