11#!/usr/bin/env python
22
3- from __future__ import annotations
4-
53from collections .abc import Callable
4+ from types import TracebackType
65from typing import TYPE_CHECKING , Any
76
87from tdclient import api , cursor , errors
98from tdclient .types import Priority
109
1110if TYPE_CHECKING :
12- from types import TracebackType
13-
1411 from tdclient .cursor import Cursor
1512
1613
@@ -23,7 +20,7 @@ def __init__(
2320 priority : Priority | None = None ,
2421 retry_limit : int | None = None ,
2522 wait_interval : int | None = None ,
26- wait_callback : Callable [[Cursor ], None ] | None = None ,
23+ wait_callback : Callable [[" Cursor" ], None ] | None = None ,
2724 ** kwargs : Any ,
2825 ) -> None :
2926 cursor_kwargs = dict ()
@@ -44,7 +41,7 @@ def __init__(
4441 self ._api = api .API (** kwargs )
4542 self ._cursor_kwargs = cursor_kwargs
4643
47- def __enter__ (self ) -> Connection :
44+ def __enter__ (self ) -> " Connection" :
4845 return self
4946
5047 def __exit__ (
@@ -68,5 +65,5 @@ def commit(self) -> None:
6865 def rollback (self ) -> None :
6966 raise errors .NotSupportedError
7067
71- def cursor (self ) -> Cursor :
68+ def cursor (self ) -> " Cursor" :
7269 return cursor .Cursor (self ._api , ** self ._cursor_kwargs )
0 commit comments