Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion stdlib/ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,13 @@ class SSLContext:
post_handshake_auth: bool
if sys.version_info >= (3, 10):
security_level: int
def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
if sys.version_info >= (3, 10):
# Using the default (None) for the `protocol` parameter is deprecated,
# but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted
def __new__(cls: type[Self], protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ...
else:
def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...

def cert_store_stats(self) -> dict[str, int]: ...
def load_cert_chain(
self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = None, password: _PasswordType | None = None
Expand Down
5 changes: 0 additions & 5 deletions tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ weakref.WeakValueDictionary.update
unittest.TestCase.__init_subclass__
unittest.case.TestCase.__init_subclass__

# stubtest complains that in 3.10 the default argument is inconsistent with the annotation,
# but in 3.10+ calling the function without the default argument is in fact deprecated,
# so it's better to ignore stubtest
ssl.SSLContext.__new__

# SpooledTemporaryFile implements IO except these methods before Python 3.11
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
tempfile.SpooledTemporaryFile.__next__
Expand Down
5 changes: 0 additions & 5 deletions tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ weakref.WeakValueDictionary.update
unittest.TestCase.__init_subclass__
unittest.case.TestCase.__init_subclass__

# stubtest complains that in 3.10 the default argument is inconsistent with the annotation,
# but in 3.10+ calling the function without the default argument is in fact deprecated,
# so it's better to ignore stubtest
ssl.SSLContext.__new__

# ==========
# Related to positional-only arguments
# ==========
Expand Down