Use Final for Constant Literals in the stdlib (#12332)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Max Muoto
2024-07-15 12:07:34 -05:00
committed by GitHub
parent 02b05d67c4
commit 0df6028dc8
41 changed files with 569 additions and 572 deletions

View File

@@ -3,7 +3,7 @@ import ssl
import sys
from builtins import list as _list # conflicts with a method named "list"
from re import Pattern
from typing import Any, BinaryIO, Literal, NoReturn, overload
from typing import Any, BinaryIO, Final, NoReturn, overload
from typing_extensions import TypeAlias
__all__ = ["POP3", "error_proto", "POP3_SSL"]
@@ -12,11 +12,11 @@ _LongResp: TypeAlias = tuple[bytes, list[bytes], int]
class error_proto(Exception): ...
POP3_PORT: Literal[110]
POP3_SSL_PORT: Literal[995]
CR: Literal[b"\r"]
LF: Literal[b"\n"]
CRLF: Literal[b"\r\n"]
POP3_PORT: Final = 110
POP3_SSL_PORT: Final = 995
CR: Final = b"\r"
LF: Final = b"\n"
CRLF: Final = b"\r\n"
HAVE_SSL: bool
class POP3: