mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-02 22:18:28 +08:00
[PyMySQL] Fix stubs for pymysql.connections.Connection.__init__ (#14724)
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
# DictCursorMixin changes method types of inherited classes, but doesn't contain much at runtime
|
||||
pymysql.cursors.DictCursorMixin.__iter__
|
||||
pymysql.cursors.DictCursorMixin.fetch[a-z]*
|
||||
|
||||
# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
|
||||
# See https://github.com/python/typeshed/pull/14699
|
||||
pymysql.connections.Connection.__init__
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from typing_extensions import assert_type
|
||||
|
||||
from pymysql.connections import Connection
|
||||
from pymysql.cursors import Cursor
|
||||
|
||||
|
||||
class MyCursor(Cursor):
|
||||
pass
|
||||
|
||||
|
||||
assert_type(Connection(), Connection[Cursor])
|
||||
assert_type(Connection(cursorclass=Cursor), Connection[Cursor])
|
||||
assert_type(Connection(cursorclass=MyCursor), Connection[MyCursor])
|
||||
|
||||
Connection(cursorclass=None) # type: ignore
|
||||
Reference in New Issue
Block a user