zeroc-ice 3.8.0__cp313-cp313-win_amd64.whl → 3.8.0.post1__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. Ice/BTEndpointType.py +7 -0
  2. Ice/BTSEndpointType.py +7 -0
  3. Ice/Blobject.py +1 -1
  4. Ice/Communicator.py +130 -118
  5. Ice/CompressBatch.py +12 -12
  6. Ice/Current.py +5 -6
  7. Ice/EndpointSelectionType.py +8 -8
  8. Ice/EventLoopAdapter.py +4 -4
  9. Ice/Exception.py +6 -8
  10. Ice/FormatType.py +8 -1
  11. Ice/Future.py +78 -78
  12. Ice/IcePyTypes.py +2 -0
  13. Ice/ImplicitContext.py +28 -35
  14. Ice/InitializationData.py +23 -22
  15. Ice/InvocationFuture.py +31 -34
  16. Ice/LocalException.py +1 -1
  17. Ice/LocalExceptions.py +82 -94
  18. Ice/LogMessageType.py +16 -15
  19. Ice/Logger.py +10 -10
  20. Ice/Object.py +22 -17
  21. Ice/ObjectAdapter.py +200 -167
  22. Ice/ObjectPrx.py +196 -202
  23. Ice/OperationMode.py +19 -14
  24. Ice/ProcessLogger.py +18 -2
  25. Ice/Properties.py +63 -79
  26. Ice/Proxy.py +73 -10
  27. Ice/ReplyStatus.py +42 -35
  28. Ice/SSLEndpointType.py +7 -0
  29. Ice/ServantLocator.py +30 -35
  30. Ice/SliceInfo.py +3 -3
  31. Ice/SlicedData.py +1 -1
  32. Ice/TCPEndpointType.py +7 -0
  33. Ice/ToStringMode.py +19 -19
  34. Ice/UDPEndpointType.py +7 -0
  35. Ice/URIEndpointType.py +7 -0
  36. Ice/UnknownSlicedValue.py +11 -3
  37. Ice/UserException.py +1 -1
  38. Ice/Util.py +27 -26
  39. Ice/Value.py +7 -7
  40. Ice/WSEndpointType.py +7 -0
  41. Ice/WSSEndpointType.py +7 -0
  42. Ice/__init__.py +2 -0
  43. Ice/iAPEndpointType.py +7 -0
  44. Ice/iAPSEndpointType.py +7 -0
  45. IceGrid/LoadSample.py +12 -12
  46. IceGrid/ServerState.py +29 -25
  47. IcePy-stubs/__init__.pyi +151 -152
  48. IcePy.cp313-win_amd64.pdb +0 -0
  49. IcePy.cp313-win_amd64.pyd +0 -0
  50. {zeroc_ice-3.8.0.dist-info → zeroc_ice-3.8.0.post1.dist-info}/METADATA +1 -1
  51. {zeroc_ice-3.8.0.dist-info → zeroc_ice-3.8.0.post1.dist-info}/RECORD +54 -54
  52. {zeroc_ice-3.8.0.dist-info → zeroc_ice-3.8.0.post1.dist-info}/WHEEL +0 -0
  53. {zeroc_ice-3.8.0.dist-info → zeroc_ice-3.8.0.post1.dist-info}/entry_points.txt +0 -0
  54. {zeroc_ice-3.8.0.dist-info → zeroc_ice-3.8.0.post1.dist-info}/top_level.txt +0 -0
Ice/Current.py CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  from dataclasses import dataclass
4
4
 
5
- from IcePy import Connection
6
-
7
5
  from .EncodingVersion import EncodingVersion
6
+ from .IcePyTypes import Connection
8
7
  from .Identity import Identity
9
8
  from .ObjectAdapter import ObjectAdapter
10
9
  from .OperationMode import OperationMode
@@ -19,8 +18,8 @@ class Current:
19
18
  ----------
20
19
  adapter : Ice.ObjectAdapter
21
20
  The object adapter that received the request.
22
- con : IcePy.Connection | None
23
- The connection that received the request. It's None when the invocation and dispatch are collocated.
21
+ con : Ice.Connection | None
22
+ The connection that received the request. It's ``None`` for collocation-optimized dispatches.
24
23
  id : Ice.Identity
25
24
  The identity of the target Ice object.
26
25
  facet : str
@@ -32,9 +31,9 @@ class Current:
32
31
  ctx : dict[str, str]
33
32
  The request context.
34
33
  requestId : int
35
- The request ID. 0 means the request is a one-way request.
34
+ The request ID. ``0`` means the request is one-way.
36
35
  encoding : Ice.EncodingVersion
37
- The encoding of the request payload.
36
+ The Slice encoding version used to marshal the payload of the request.
38
37
  """
39
38
 
40
39
  adapter: ObjectAdapter
@@ -5,18 +5,18 @@ from enum import Enum
5
5
 
6
6
  class EndpointSelectionType(Enum):
7
7
  """
8
- Determines the order in which the Ice runtime uses the endpoints in a proxy when establishing a connection.
9
-
10
- Enumerators
11
- -----------
12
- Random : EndpointSelectionType
13
- Random causes the endpoints to be arranged in a random order.
14
- Ordered : EndpointSelectionType
15
- Ordered forces the Ice runtime to use the endpoints in the order they appeared in the proxy.
8
+ Determines how the Ice runtime sorts proxy endpoints when establishing a connection.
16
9
  """
17
10
 
18
11
  Random = 0
12
+ """
13
+ The Ice runtime shuffles the endpoints in a random order.
14
+ """
15
+
19
16
  Ordered = 1
17
+ """
18
+ The Ice runtime uses the endpoints in the order they appear in the proxy.
19
+ """
20
20
 
21
21
 
22
22
  __all__ = ["EndpointSelectionType"]
Ice/EventLoopAdapter.py CHANGED
@@ -18,8 +18,8 @@ class EventLoopAdapter(ABC):
18
18
  @abstractmethod
19
19
  def runCoroutine(self, coroutine: Coroutine) -> FutureLike:
20
20
  """
21
- Run a coroutine in the application configured event loop. The Ice run time will call this method to run
22
- coroutines returned by async dispatch methods. This method is called from the Ice dispatch thread.
21
+ Runs a coroutine in the application-configured event loop. The Ice run time will call this function to run
22
+ coroutines returned by async dispatch methods. This function is called from the Ice dispatch thread.
23
23
 
24
24
  Parameters
25
25
  ----------
@@ -36,8 +36,8 @@ class EventLoopAdapter(ABC):
36
36
  @abstractmethod
37
37
  def wrapFuture(self, future: Future) -> Awaitable:
38
38
  """
39
- Wraps an Ice.Future so that it can be awaited in the application event loop. The Ice run time calls this method
40
- before returning a future to the application.
39
+ Wraps an :class:`Ice.Future` so that it can be awaited in the application event loop.
40
+ The Ice run time calls this function before returning a future to the application.
41
41
 
42
42
  Parameters
43
43
  ----------
Ice/Exception.py CHANGED
@@ -5,23 +5,21 @@ from builtins import Exception as BuiltinsException
5
5
 
6
6
  class Exception(BuiltinsException):
7
7
  """
8
- The base class for all Ice exceptions.
8
+ Abstract base class for all Ice exceptions.
9
+ It has only two derived classes: :class:`LocalException` and :class:`UserException`.
9
10
  """
10
11
 
11
12
  _ice_id: str
12
13
 
13
- def ice_id(self):
14
+ def ice_id(self) -> str:
14
15
  """
15
- Return the type ID of this exception.
16
-
17
- For exceptions defined in Slice, this corresponds to the Slice type ID.
18
- For other exceptions, it is a fully scoped name in the same format.
19
- For example: "::Ice::CommunicatorDestroyedException".
16
+ Returns the type ID of this exception. This corresponds to the Slice type ID for Slice-defined exceptions,
17
+ and to a fully scoped name for other exceptions. For example: ``"::Ice::CommunicatorDestroyedException"``.
20
18
 
21
19
  Returns
22
20
  -------
23
21
  str
24
- The type ID of the exception.
22
+ The type ID of this exception.
25
23
  """
26
24
  return self._ice_id
27
25
 
Ice/FormatType.py CHANGED
@@ -5,11 +5,18 @@ from enum import Enum
5
5
 
6
6
  class FormatType(Enum):
7
7
  """
8
- This enumeration describes the possible formats for classes and exceptions.
8
+ Specifies the format for marshaling classes and exceptions with the Slice 1.1 encoding.
9
9
  """
10
10
 
11
11
  CompactFormat = 0
12
+ """
13
+ Favors compactness, but does not support slicing-off unknown slices during unmarshaling.
14
+ """
15
+
12
16
  SlicedFormat = 1
17
+ """
18
+ Allows slicing-off unknown slices during unmarshaling, at the cost of some extra space in the marshaled data.
19
+ """
13
20
 
14
21
 
15
22
  __all__ = ["FormatType"]
Ice/Future.py CHANGED
@@ -31,17 +31,16 @@ class Future(Awaitable[_T]):
31
31
  yield self
32
32
  return self.result()
33
33
 
34
- def cancel(self):
34
+ def cancel(self) -> bool:
35
35
  """
36
- Attempt to cancel the operation.
36
+ Attempts to cancel this future.
37
37
 
38
- If the operation is already running or has completed, it cannot be cancelled, and the method returns False.
39
- Otherwise, the operation is cancelled, and the method returns True.
38
+ If this future is already running or has completed, it cannot be cancelled.
40
39
 
41
40
  Returns
42
41
  -------
43
42
  bool
44
- True if the operation was cancelled, False otherwise.
43
+ ``True`` if this future was cancelled, ``False`` otherwise.
45
44
  """
46
45
  callbacks = []
47
46
  with self._condition:
@@ -60,57 +59,52 @@ class Future(Awaitable[_T]):
60
59
 
61
60
  return True
62
61
 
63
- def cancelled(self):
62
+ def cancelled(self) -> bool:
64
63
  """
65
- Check if the future has been cancelled.
64
+ Checks if this future has been cancelled.
66
65
 
67
66
  Returns
68
67
  -------
69
68
  bool
70
- True if the future was cancelled using `cancel()`, otherwise False.
69
+ ``True`` if this future was cancelled, otherwise ``False``.
71
70
  """
72
71
  with self._condition:
73
72
  return self._state == Future.StateCancelled
74
73
 
75
- def running(self):
74
+ def running(self) -> bool:
76
75
  """
77
- Check if the future is still running.
76
+ Checks if this future is still running.
78
77
 
79
78
  Returns
80
79
  -------
81
80
  bool
82
- True if the operation is currently executing and cannot be cancelled,
83
- otherwise False.
81
+ ``True`` if this future is currently executing, otherwise ``False``.
84
82
  """
85
83
  with self._condition:
86
84
  return self._state == Future.StateRunning
87
85
 
88
- def done(self):
86
+ def done(self) -> bool:
89
87
  """
90
- Check if the future has completed or been cancelled.
88
+ Checks if this future has completed or been cancelled.
91
89
 
92
90
  Returns
93
91
  -------
94
92
  bool
95
- True if the operation has completed (successfully or with an exception)
96
- or has been cancelled, otherwise False.
93
+ ``True`` if this future has completed (either successfully or with an exception), or has been cancelled,
94
+ otherwise ``False``.
97
95
  """
98
96
  with self._condition:
99
97
  return self._state in [Future.StateCancelled, Future.StateDone]
100
98
 
101
- def add_done_callback(self, fn: Callable) -> None:
99
+ def add_done_callback(self, fn: Callable[["Future"], Any]) -> None:
102
100
  """
103
- Attach a callback to be executed when the future completes.
104
-
105
- The callback `fn` is called with the future as its only argument once the future completes or is cancelled.
106
- Registered callbacks are executed in the order they were added.
107
-
108
- If the future is already complete, `fn` is called immediately from the calling thread.
101
+ Attaches a callback function which will be called when this future completes or is cancelled.
102
+ If this future is already complete, ``fn`` is called immediately from the calling thread.
109
103
 
110
104
  Parameters
111
105
  ----------
112
- fn : callable
113
- The function to execute upon completion. Takes the future as its argument.
106
+ fn : Callable[[Future], Any]
107
+ The function to execute upon completion.
114
108
  """
115
109
  with self._condition:
116
110
  if self._state == Future.StateRunning:
@@ -120,20 +114,16 @@ class Future(Awaitable[_T]):
120
114
 
121
115
  def result(self, timeout: int | float | None = None) -> _T:
122
116
  """
123
- Retrieve the result of the future.
124
-
125
- If the operation has not completed, this method waits up to `timeout` seconds for it to finish. If the
126
- timeout is reached, a `TimeoutException` is raised.
117
+ Retrieves the result of this future's operation.
127
118
 
128
- If the future was cancelled before completing, an `InvocationCanceledException` is raised.
129
-
130
- If the operation raised an exception, this method raises the same exception.
119
+ If the operation has not completed, this function will wait up to ``timeout``-many seconds for it to finish.
120
+ If the operation raised an exception, this function raises the same exception.
131
121
 
132
122
  Parameters
133
123
  ----------
134
- timeout : int | float, optional
135
- Maximum time (in seconds) to wait for the result. If `None`, the method waits indefinitely until the
136
- operation completes.
124
+ timeout : int | float | None, optional
125
+ Maximum time (in seconds) to wait for the result.
126
+ If ``None`` (the default), this function waits indefinitely until the operation completes.
137
127
 
138
128
  Returns
139
129
  -------
@@ -164,25 +154,20 @@ class Future(Awaitable[_T]):
164
154
 
165
155
  def exception(self, timeout: int | float | None = None) -> BaseException | None:
166
156
  """
167
- Retrieve the exception raised by the operation.
168
-
169
- If the operation has not completed, this method waits up to `timeout` seconds for it to finish. If the timeout
170
- is reached, a `TimeoutException` is raised.
157
+ Retrieves the exception raised by this future's operation.
171
158
 
172
- If the future was cancelled before completing, an `InvocationCanceledException` is raised.
173
-
174
- If the operation completed successfully without raising an exception, `None` is returned.
159
+ If the operation has not completed, this function will wait up to ``timeout``-many seconds for it to finish.
175
160
 
176
161
  Parameters
177
162
  ----------
178
- timeout : int | float, optional
179
- Maximum time (in seconds) to wait for the exception. If `None`, the method waits indefinitely until the
180
- operation completes.
163
+ timeout : int | float | None, optional
164
+ Maximum time (in seconds) to wait for the exception.
165
+ If ``None`` (the default), this function waits indefinitely until the operation completes.
181
166
 
182
167
  Returns
183
168
  -------
184
- BaseException or None
185
- The exception raised by the operation, or `None` if the operation completed successfully.
169
+ BaseException | None
170
+ The exception raised by the operation, or ``None`` if the operation completed successfully.
186
171
 
187
172
  Raises
188
173
  ------
@@ -201,12 +186,12 @@ class Future(Awaitable[_T]):
201
186
 
202
187
  def set_result(self, result: _T):
203
188
  """
204
- Set the result of the future and mark it as completed.
189
+ Sets the result of this future and marks it as completed.
205
190
 
206
- This method stores the provided `result` and transitions the future's state to "done". Any registered
207
- callbacks are executed after the state update.
191
+ This function stores the provided ``result`` and transitions the future's state to "done".
192
+ Any registered callbacks are executed after the state update.
208
193
 
209
- If the future is not in a running state, this method has no effect.
194
+ If the future is not in a running state, this function has no effect.
210
195
 
211
196
  Parameters
212
197
  ----------
@@ -227,12 +212,12 @@ class Future(Awaitable[_T]):
227
212
 
228
213
  def set_exception(self, ex: BaseException):
229
214
  """
230
- Set an exception for the future and mark it as completed.
215
+ Sets an exception for this future and marks it as completed.
231
216
 
232
- This method stores the provided exception `ex` and transitions the future's state to "done". Any registered
233
- callbacks are executed after the state update.
217
+ This function stores the provided exception ``ex`` and transitions the future's state to "done".
218
+ Any registered callbacks are executed after the state update.
234
219
 
235
- If the future is not in a running state, this method has no effect.
220
+ If the future is not in a running state, this function has no effect.
236
221
 
237
222
  Parameters
238
223
  ----------
@@ -286,34 +271,33 @@ class Future(Awaitable[_T]):
286
271
 
287
272
  def wrap_future(future: Future | asyncio.Future, *, loop: asyncio.AbstractEventLoop | None = None) -> asyncio.Future:
288
273
  """
289
- Wrap an :class:`Ice.Future` object into an ``asyncio.Future``.
274
+ Wraps an :class:`Ice.Future` object into an ``asyncio.Future``.
290
275
 
291
- This function converts an Ice.Future into an asyncio.Future to allow integration of Ice's
276
+ This function converts an :class:`Ice.Future` into an ``asyncio.Future`` to allow integration of Ice's
292
277
  asynchronous operations with Python's asyncio framework. If the provided future is already
293
- an asyncio.Future, it is returned unchanged.
278
+ an ``asyncio.Future``, it is returned unchanged.
294
279
 
295
- If the Ice.Future is already completed, the asyncio.Future is immediately resolved. Otherwise,
296
- completion callbacks are registered to ensure that the asyncio.Future reflects the state of the
297
- Ice.Future, including result propagation, exception handling, and cancellation.
280
+ If the :class:`Ice.Future` is already completed, the ``asyncio.Future`` is immediately resolved. Otherwise,
281
+ completion callbacks are registered to ensure that the ``asyncio.Future`` reflects the state of the
282
+ :class:`Ice.Future`, including result propagation, exception handling, and cancellation.
298
283
 
299
284
  Parameters
300
285
  ----------
301
286
  future : Future | asyncio.Future
302
- The Ice.Future object to wrap. If an asyncio.Future is passed, it is returned as-is.
287
+ The future object to wrap. If an ``asyncio.Future`` is passed, it is returned as-is.
303
288
 
304
- loop : asyncio.AbstractEventLoop, optional
305
- The event loop to associate with the asyncio.Future. If not provided, the current event loop
306
- is used.
289
+ loop : asyncio.AbstractEventLoop | None, optional
290
+ The event loop to associate with the ``asyncio.Future``. If not provided, the current event loop is used.
307
291
 
308
292
  Returns
309
293
  -------
310
294
  asyncio.Future
311
- A future that mirrors the state of the input Ice.Future.
295
+ A future that mirrors the state of the provided :class:`Ice.Future`.
312
296
 
313
297
  Raises
314
298
  ------
315
299
  AssertionError
316
- If `future` is not an instance of Ice.Future or asyncio.Future.
300
+ If ``future`` is not an instance of :class:`Ice.Future` or ``asyncio.Future``.
317
301
  """
318
302
 
319
303
  if isinstance(future, asyncio.Future):
@@ -342,7 +326,7 @@ def wrap_future(future: Future | asyncio.Future, *, loop: asyncio.AbstractEventL
342
326
 
343
327
  if future.done():
344
328
  # As long as no done callbacks are registered, completing the asyncio future should be thread safe
345
- # even if the future is constructed with a loop which isn't the current thread's loop.
329
+ # even if this future is constructed with a loop which isn't the current thread's loop.
346
330
  forwardCompletion(future, asyncioFuture)
347
331
  else:
348
332
  asyncioFuture.add_done_callback(lambda f: forwardCompletion(asyncioFuture, future))
@@ -352,23 +336,39 @@ def wrap_future(future: Future | asyncio.Future, *, loop: asyncio.AbstractEventL
352
336
 
353
337
 
354
338
  class FutureLike(Protocol[_T_co]):
355
- """A protocol that defines the interface for objects that behave like a Future."""
339
+ """A protocol that defines an interface for objects that behave like a ``Future``."""
356
340
 
341
+ # We use a positional-only parameter (/) to match both `asyncio` and `concurrent.futures`
342
+ # implementations (since the two implementations use different parameter names).
357
343
  def add_done_callback(self, callback: Callable[["FutureLike"], Any], /) -> None:
358
- """Add a callback to be run when the Future is done.
359
-
360
- Args:
361
- callback: A callable that takes the Future object as its only argument.
362
- Will be called when the Future completes (successfully,
363
- with exception, or cancelled).
344
+ """
345
+ Adds a callback to be run when the ``Future`` is done.
364
346
 
365
- Note: Using positional-only parameter (/) to match both asyncio and
366
- concurrent.futures implementations regardless of parameter name.
347
+ Parameters
348
+ ----------
349
+ callback: Callable[[FutureLike], Any]
350
+ A callable that takes the ``Future`` object as its only argument.
351
+ Will be called when the ``Future`` completes (successfully, with exception, or cancelled).
367
352
  """
368
353
  ...
369
354
 
370
355
  def result(self, timeout: int | float | None = None) -> _T_co:
371
- """Return the result of the Future."""
356
+ """
357
+ Retrieves the result of the ``Future``.
358
+
359
+ If the ``Future`` has not completed, this function will wait up to ``timeout``-many seconds for it to finish.
360
+
361
+ Parameters
362
+ ----------
363
+ timeout : int | float | None, optional
364
+ Maximum time (in seconds) to wait for the result.
365
+ If ``None`` (the default), this function waits indefinitely until the operation completes.
366
+
367
+ Returns
368
+ -------
369
+ object
370
+ The result of the ``Future``.
371
+ """
372
372
  ...
373
373
 
374
374
 
Ice/IcePyTypes.py CHANGED
@@ -6,6 +6,7 @@ from IcePy import (
6
6
  BatchRequest,
7
7
  Connection,
8
8
  ConnectionInfo,
9
+ Endpoint,
9
10
  EndpointInfo,
10
11
  IPConnectionInfo,
11
12
  IPEndpointInfo,
@@ -28,6 +29,7 @@ __all__ = [
28
29
  "BatchRequest",
29
30
  "Connection",
30
31
  "ConnectionInfo",
32
+ "Endpoint",
31
33
  "EndpointInfo",
32
34
  "IPConnectionInfo",
33
35
  "IPEndpointInfo",
Ice/ImplicitContext.py CHANGED
@@ -8,24 +8,19 @@ import IcePy
8
8
  @final
9
9
  class ImplicitContext:
10
10
  """
11
- An interface to associate implicit contexts with communicators.
11
+ Represents the request context associated with a communicator.
12
+ When you make a remote invocation without an explicit request context parameter, Ice uses the per-proxy request
13
+ context (if any) combined with the ``ImplicitContext`` associated with your communicator.
12
14
 
13
- When you make a remote invocation without an explicit context parameter, Ice uses the per-proxy context (if any)
14
- combined with the ImplicitContext associated with the communicator.
15
+ The property ``Ice.ImplicitContext`` controls if your communicator has an associated implicit context,
16
+ and when it does, whether this implicit context is per-thread or shared by all threads:
15
17
 
16
- Ice provides several implementations of ImplicitContext. The implementation used depends on the value of the
17
- `Ice.ImplicitContext` property.
18
-
19
- None (default)
18
+ - None (default):
20
19
  No implicit context at all.
21
- PerThread
20
+ - PerThread:
22
21
  The implementation maintains a context per thread.
23
- Shared
22
+ - Shared:
24
23
  The implementation maintains a single context shared by all threads.
25
-
26
-
27
- ImplicitContext also provides a number of operations to create, update, or retrieve an entry in the underlying
28
- context without first retrieving a copy of the entire context.
29
24
  """
30
25
 
31
26
  def __init__(self, impl: IcePy.ImplicitContext):
@@ -33,92 +28,90 @@ class ImplicitContext:
33
28
 
34
29
  def getContext(self) -> dict[str, str]:
35
30
  """
36
- Get a copy of the underlying context.
31
+ Gets a copy of the request context maintained by this object.
37
32
 
38
33
  Returns
39
34
  -------
40
- dict
41
- A copy of the underlying context.
35
+ dict[str, str]
36
+ A copy of the request context.
42
37
  """
43
38
  return self._impl.getContext()
44
39
 
45
40
  def setContext(self, newContext: dict[str, str]):
46
41
  """
47
- Set the underlying context.
42
+ Sets the request context.
48
43
 
49
44
  Parameters
50
45
  ----------
51
- newContext : dict
52
- The new context to set.
46
+ newContext : dict[str, str]
47
+ The new request context.
53
48
  """
54
49
  self._impl.setContext(newContext)
55
50
 
56
51
  def containsKey(self, key: str) -> bool:
57
52
  """
58
- Check if this key has an associated value in the underlying context.
53
+ Checks if the specified key has an associated value in the request context.
59
54
 
60
55
  Parameters
61
56
  ----------
62
57
  key : str
63
- The key to check.
58
+ The key.
64
59
 
65
60
  Returns
66
61
  -------
67
62
  bool
68
- True if the key has an associated value, False otherwise.
63
+ ``True`` if the key has an associated value, ``False`` otherwise.
69
64
  """
70
65
  return self._impl.containsKey(key)
71
66
 
72
67
  def get(self, key: str) -> str:
73
68
  """
74
- Get the value associated with the given key in the underlying context.
75
-
76
- Returns an empty string if no value is associated with the key. Use `containsKey` to distinguish between an
77
- empty-string value and no value at all.
69
+ Gets the value associated with the specified key in the request context.
78
70
 
79
71
  Parameters
80
72
  ----------
81
73
  key : str
82
- The key to retrieve the value for.
74
+ The key.
83
75
 
84
76
  Returns
85
77
  -------
86
78
  str
87
- The value associated with the key, or an empty string if no value is associated with the key.
79
+ The value associated with the key, or the empty string if no value is associated with the key.
80
+ :func:`containsKey` allows you to distinguish between an empty-string value and no value at all.
88
81
  """
89
82
  return self._impl.get(key)
90
83
 
91
84
  def put(self, key: str, value: str) -> str | None:
92
85
  """
93
- Create or update a key/value entry in the underlying context.
86
+ Creates or updates a key/value entry in the request context.
94
87
 
95
88
  Parameters
96
89
  ----------
97
90
  key : str
98
- The key to create or update.
91
+ The key.
99
92
  value : str
100
- The value to associate with the key.
93
+ The value.
101
94
 
102
95
  Returns
103
96
  -------
104
97
  str | None
105
- The previous value associated with the key, if any, otherwise None.
98
+ The previous value associated with the key, if any.
106
99
  """
107
100
  return self._impl.put(key, value)
108
101
 
109
102
  def remove(self, key: str) -> str | None:
110
103
  """
111
- Remove the entry for the given key in the underlying context.
104
+ Removes the entry for the specified key in the request context.
112
105
 
113
106
  Parameters
114
107
  ----------
115
108
  key : str
116
- The key to remove.
109
+ The key.
117
110
 
118
111
  Returns
119
112
  -------
120
113
  str | None
121
- The value associated with the key, if any, otherwise None.
114
+ The value associated with the key, if any.
122
115
  """
123
116
  return self._impl.remove(key)
124
117