140140 Any ,
141141 Callable ,
142142 ContextManager ,
143- Generic ,
144143 Mapping ,
145144 NoReturn ,
146145 Optional ,
164163from pymongo .read_concern import ReadConcern
165164from pymongo .read_preferences import ReadPreference , _ServerMode
166165from pymongo .server_type import SERVER_TYPE
167- from pymongo .typings import _DocumentType
168166from pymongo .write_concern import WriteConcern
169167
170168
@@ -461,7 +459,7 @@ def _within_time_limit(start_time):
461459 from pymongo .mongo_client import MongoClient
462460
463461
464- class ClientSession ( Generic [ _DocumentType ]) :
462+ class ClientSession :
465463 """A session for ordering sequential operations.
466464
467465 :class:`ClientSession` instances are **not thread-safe or fork-safe**.
@@ -476,13 +474,13 @@ class ClientSession(Generic[_DocumentType]):
476474
477475 def __init__ (
478476 self ,
479- client : "MongoClient[_DocumentType] " ,
477+ client : "MongoClient" ,
480478 server_session : Any ,
481479 options : SessionOptions ,
482480 implicit : bool ,
483481 ) -> None :
484482 # A MongoClient, a _ServerSession, a SessionOptions, and a set.
485- self ._client : MongoClient [ _DocumentType ] = client
483+ self ._client : MongoClient = client
486484 self ._server_session = server_session
487485 self ._options = options
488486 self ._cluster_time = None
@@ -515,14 +513,14 @@ def _check_ended(self):
515513 if self ._server_session is None :
516514 raise InvalidOperation ("Cannot use ended session" )
517515
518- def __enter__ (self ) -> "ClientSession[_DocumentType] " :
516+ def __enter__ (self ) -> "ClientSession" :
519517 return self
520518
521519 def __exit__ (self , exc_type : Any , exc_val : Any , exc_tb : Any ) -> None :
522520 self ._end_session (lock = True )
523521
524522 @property
525- def client (self ) -> "MongoClient[_DocumentType] " :
523+ def client (self ) -> "MongoClient" :
526524 """The :class:`~pymongo.mongo_client.MongoClient` this session was
527525 created from.
528526 """
0 commit comments