diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 56146ead565b..d42b1e05a456 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -22,7 +22,6 @@ select.poll # Depends on configuration socketserver.BaseServer.fileno # implemented in derived classes socketserver.BaseServer.get_request # implemented in derived classes socketserver.BaseServer.server_bind # implemented in derived classes -ssl.Purpose.__new__ # the multiple inheritance confuses mypy tkinter.simpledialog.[A-Z_]+ tkinter.simpledialog.TclVersion tkinter.simpledialog.TkVersion diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index f587b51d5ac0..388e521c1ef5 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -325,6 +325,10 @@ class _ASN1Object(_ASN1ObjectBase): def fromname(cls, name: str) -> Self: ... class Purpose(_ASN1Object, enum.Enum): + # Normally this class would inherit __new__ from _ASN1Object, but + # because this is an enum, the inherited __new__ is replaced at runtime with + # Enum.__new__. + def __new__(cls, value: object) -> Self: ... SERVER_AUTH = (129, "serverAuth", "TLS Web Server Authentication", "1.3.6.1.5.5.7.3.2") # pyright: ignore[reportCallIssue] CLIENT_AUTH = (130, "clientAuth", "TLS Web Client Authentication", "1.3.6.1.5.5.7.3.1") # pyright: ignore[reportCallIssue]