@@ -36,6 +36,7 @@ from ..sql import Executable
36
36
from ..sql .base import Options
37
37
38
38
_T = TypeVar ("_T" )
39
+ _M = TypeVar ("_M" )
39
40
_TSession = TypeVar ("_TSession" , bound = Session )
40
41
_TSessionNoIoTypingCommon = TypeVar (
41
42
"_TSession" , bound = _SessionNoIoTypingCommon
@@ -150,7 +151,7 @@ class _SessionProtocol(
150
151
def delete (self , instance : Any ) -> None : ...
151
152
def get (
152
153
self ,
153
- entity : Type [_T ],
154
+ entity : Type [_M ],
154
155
ident : Any ,
155
156
options : Optional [Sequence [Any ]] = ...,
156
157
populate_existing : bool = ...,
@@ -159,13 +160,13 @@ class _SessionProtocol(
159
160
] = ...,
160
161
identity_token : Optional [Any ] = ...,
161
162
execution_options : Optional [_ExecuteOptions ] = ...,
162
- ) -> Optional [_T ]: ...
163
+ ) -> Optional [_M ]: ...
163
164
def merge (
164
165
self ,
165
- instance : _T ,
166
+ instance : _M ,
166
167
load : bool = ...,
167
168
options : Optional [Sequence [Any ]] = ...,
168
- ) -> _T : ...
169
+ ) -> _M : ...
169
170
def flush (self , objects : Optional [Collection [Any ]] = ...) -> None : ...
170
171
@classmethod
171
172
def close_all (cls ) -> None : ... # NOTE: Deprecated.
@@ -376,7 +377,7 @@ class _SessionTypingCommon(
376
377
def flush (self , objects : Optional [Collection [Any ]] = ...) -> None : ...
377
378
def get (
378
379
self ,
379
- entity : Type [_T ],
380
+ entity : Type [_M ],
380
381
ident : Any ,
381
382
options : Optional [Sequence [Any ]] = ...,
382
383
populate_existing : bool = ...,
@@ -385,7 +386,7 @@ class _SessionTypingCommon(
385
386
] = ...,
386
387
identity_token : Optional [Any ] = ...,
387
388
execution_options : Optional [_ExecuteOptions ] = ...,
388
- ) -> Optional [_T ]: ...
389
+ ) -> Optional [_M ]: ...
389
390
def bulk_save_objects (
390
391
self ,
391
392
objects : Sequence [Any ],
@@ -405,10 +406,10 @@ class _SessionTypingCommon(
405
406
) -> None : ...
406
407
def merge (
407
408
self ,
408
- instance : _T ,
409
+ instance : _M ,
409
410
load : bool = ...,
410
411
options : Optional [Sequence [Any ]] = ...,
411
- ) -> _T : ...
412
+ ) -> _M : ...
412
413
def query (self , * entities : Any , ** kwargs : Any ) -> Query [Any ]: ...
413
414
def refresh (
414
415
self ,
0 commit comments