Skip to content

Commit aaa8a7c

Browse files
authored
ssl.Purpose.__new__ comes from Enum (#13237)
1 parent 3944c78 commit aaa8a7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

stdlib/@tests/stubtest_allowlists/common.txt

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ select.poll # Depends on configuration
2222
socketserver.BaseServer.fileno # implemented in derived classes
2323
socketserver.BaseServer.get_request # implemented in derived classes
2424
socketserver.BaseServer.server_bind # implemented in derived classes
25-
ssl.Purpose.__new__ # the multiple inheritance confuses mypy
2625
tkinter.simpledialog.[A-Z_]+
2726
tkinter.simpledialog.TclVersion
2827
tkinter.simpledialog.TkVersion

stdlib/ssl.pyi

+4
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ class _ASN1Object(_ASN1ObjectBase):
325325
def fromname(cls, name: str) -> Self: ...
326326

327327
class Purpose(_ASN1Object, enum.Enum):
328+
# Normally this class would inherit __new__ from _ASN1Object, but
329+
# because this is an enum, the inherited __new__ is replaced at runtime with
330+
# Enum.__new__.
331+
def __new__(cls, value: object) -> Self: ...
328332
SERVER_AUTH = (129, "serverAuth", "TLS Web Server Authentication", "1.3.6.1.5.5.7.3.2") # pyright: ignore[reportCallIssue]
329333
CLIENT_AUTH = (130, "clientAuth", "TLS Web Client Authentication", "1.3.6.1.5.5.7.3.1") # pyright: ignore[reportCallIssue]
330334

0 commit comments

Comments
 (0)