From f7166fc6ea2eb71ddb8b6428177c2e5830f0241e Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Sun, 24 Jul 2022 07:48:47 -0400 Subject: [PATCH] Add return type to MySQLdb.Connection.__enter__ (#8381) This pull request adds the return type, as seen in the link below, to the `mysqlclient.MySQLdb.connections:Connection.__enter__` https://github.com/PyMySQL/mysqlclient/blob/main/MySQLdb/connections.py#L230-L231 --- stubs/mysqlclient/MySQLdb/connections.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stubs/mysqlclient/MySQLdb/connections.pyi b/stubs/mysqlclient/MySQLdb/connections.pyi index 93bc84a1d..e3f48d2d7 100644 --- a/stubs/mysqlclient/MySQLdb/connections.pyi +++ b/stubs/mysqlclient/MySQLdb/connections.pyi @@ -1,3 +1,4 @@ +from _typeshed import Self from typing import Any from . import _mysql, cursors as cursors @@ -25,7 +26,7 @@ class Connection(_mysql.connection): encoding: str messages: Any def __init__(self, *args, **kwargs): ... - def __enter__(self): ... + def __enter__(self: Self) -> Self: ... def __exit__(self, exc_type, exc_value, traceback) -> None: ... def autocommit(self, on) -> None: ... def cursor(self, cursorclass: Any | None = ...): ...