Skip to content

Commit e9edcad

Browse files
committed
docs(toolbox-core): Improve docstrings for context manager functions in sync client.
1 parent bf4bed3 commit e9edcad

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

packages/toolbox-core/src/toolbox_core/sync_client.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,22 @@ def add_headers(
176176
self.__async_client.add_headers(headers)
177177

178178
def __enter__(self):
179-
"""Enter the runtime context related to this client instance."""
179+
"""
180+
Enter the runtime context related to this client instance.
181+
182+
Allows the client to be used as a context manager
183+
(e.g., `with ToolboxSyncClient(...) as client:`).
184+
185+
Returns:
186+
self: The client instance itself.
187+
"""
180188
return self
181189

182190
def __exit__(self, exc_type, exc_val, exc_tb):
183-
"""Exit the runtime context and close the client session."""
191+
"""
192+
Exit the runtime context and close the internally managed session.
193+
194+
Allows the client to be used as a context manager
195+
(e.g., `with ToolboxSyncClient(...) as client:`).
196+
"""
184197
self.close()

0 commit comments

Comments
 (0)