Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl.Purpose.__new__ comes from Enum #13237

Merged
merged 2 commits into from
Dec 24, 2024
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
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
Loading