File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 184184_SESSION : ContextVar [Optional [ClientSession ]] = ContextVar ("SESSION" , default = None )
185185
186186
187- class BoundSessionContext :
187+ class _BoundSessionContext :
188188 """Context manager returned by ClientSession.bind() that manages bound state."""
189189
190190 def __init__ (self , session : ClientSession , end_session : bool ) -> None :
@@ -569,14 +569,14 @@ def _check_ended(self) -> None:
569569 if self ._server_session is None :
570570 raise InvalidOperation ("Cannot use ended session" )
571571
572- def bind (self , end_session : bool = False ) -> BoundSessionContext :
572+ def bind (self , end_session : bool = False ) -> _BoundSessionContext :
573573 """Bind this session so it is implicitly passed to all database operations within the returned context.
574574
575575 :param end_session: Whether to end the session on exiting the returned context. Defaults to False.
576576
577577 .. versionadded:: 4.17
578578 """
579- return BoundSessionContext (self , end_session )
579+ return _BoundSessionContext (self , end_session )
580580
581581 def __enter__ (self ) -> ClientSession :
582582 return self
Original file line number Diff line number Diff line change 3737 "AsyncRawBatchCursor" : "RawBatchCursor" ,
3838 "AsyncRawBatchCommandCursor" : "RawBatchCommandCursor" ,
3939 "AsyncClientSession" : "ClientSession" ,
40- "_AsyncBoundSessionContext" : "BoundSessionContext " ,
40+ "_AsyncBoundSessionContext" : "_BoundSessionContext " ,
4141 "AsyncChangeStream" : "ChangeStream" ,
4242 "AsyncCollectionChangeStream" : "CollectionChangeStream" ,
4343 "AsyncDatabaseChangeStream" : "DatabaseChangeStream" ,
You can’t perform that action at this time.
0 commit comments