Skip to content

Commit

Permalink
ssl.Purpose.__new__ comes from Enum (#13237)
Browse files Browse the repository at this point in the history
  • Loading branch information
tungol authored Dec 24, 2024
1 parent 3944c78 commit aaa8a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions stdlib/ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit aaa8a7c

Please sign in to comment.