Remove ClassVar from SSLContext.ssl{object,socket}_class (#7465)

These attributes have class-level defaults, but the docs explicitly state that it's OK to override them on instances.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Patrick Rauscher
2022-03-09 09:53:18 +01:00
committed by GitHub
parent 9c737f1326
commit c987c78077

View File

@@ -2,7 +2,7 @@ import enum
import socket
import sys
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
from typing import Any, Callable, ClassVar, Iterable, NamedTuple, Optional, Union, overload
from typing import Any, Callable, Iterable, NamedTuple, Optional, Union, overload
from typing_extensions import Literal, TypedDict, final
_PCTRTT = tuple[tuple[str, str], ...]
@@ -393,8 +393,11 @@ class SSLContext:
maximum_version: TLSVersion
minimum_version: TLSVersion
sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None
sslobject_class: ClassVar[type[SSLObject]]
sslsocket_class: ClassVar[type[SSLSocket]]
# The following two attributes have class-level defaults.
# However, the docs explicitly state that it's OK to override these attributes on instances,
# so making these ClassVars wouldn't be appropriate
sslobject_class: type[SSLObject]
sslsocket_class: type[SSLSocket]
if sys.version_info >= (3, 8):
keylog_filename: str
post_handshake_auth: bool