Skip to content

Commit 6586745

Browse files
Update Interceptors to use TypedProperties
1 parent b345627 commit 6586745

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/smithy-core/src/smithy_core/interceptors.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
from copy import copy, deepcopy
4-
from typing import Any, TypeVar
4+
from typing import TypeVar
5+
6+
from .types import TypedProperties
57

68
Request = TypeVar("Request")
79
Response = TypeVar("Response")
@@ -34,7 +36,7 @@ def __init__(
3436
self._response = response
3537
self._transport_request = transport_request
3638
self._transport_response = transport_response
37-
self._properties: dict[str, Any] = {}
39+
self._properties = TypedProperties()
3840

3941
@property
4042
def request(self) -> Request:
@@ -73,7 +75,7 @@ def transport_response(self) -> TransportResponse:
7375
return self._transport_response
7476

7577
@property
76-
def properties(self) -> dict[str, Any]:
78+
def properties(self) -> TypedProperties:
7779
"""Retrieve the generic property bag.
7880
7981
These untyped properties will be made available to all other interceptors or

packages/smithy-core/src/smithy_core/interfaces/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class PropertyKey[T](Protocol):
108108
"""The string key used to access the value."""
109109

110110
value_type: type[T]
111-
"""The type that of the associated value in the properties bag."""
111+
"""The type of the associated value in the properties bag."""
112112

113113
def __str__(self) -> str:
114114
return self.key

packages/smithy-core/src/smithy_core/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class PropertyKey[T](_PropertyKey[T]):
167167
"""The string key used to access the value."""
168168

169169
value_type: type[T]
170-
"""The type that of the associated value in the property bag."""
170+
"""The type of the associated value in the property bag."""
171171

172172
def __init__(self, *, key: str, value_type: type[T]) -> None:
173173
# Intern the key to speed up dict access

0 commit comments

Comments
 (0)