Skip to content

Commit b08ef70

Browse files
asasvariattila-s
authored andcommitted
black
1 parent f89d8a9 commit b08ef70

File tree

1 file changed

+7
-4
lines changed
  • opentelemetry-api/src/opentelemetry/attributes

1 file changed

+7
-4
lines changed

opentelemetry-api/src/opentelemetry/attributes/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ def __init__(
149149
self.max_value_len = max_value_len
150150
# OrderedDict is not used until the maxlen is reached for efficiency.
151151

152-
self._dict: MutableMapping[str, types.AttributeValue] | OrderedDict[str, types.AttributeValue] = {}
152+
self._dict: (
153+
MutableMapping[str, types.AttributeValue]
154+
| OrderedDict[str, types.AttributeValue]
155+
) = {}
153156
self._lock = threading.RLock()
154157
if attributes:
155158
for key, value in attributes.items():
@@ -159,7 +162,7 @@ def __init__(
159162
def __repr__(self) -> str:
160163
return f"{dict(self._dict)}"
161164

162-
def __getitem__(self, key: str)-> types.AttributeValue:
165+
def __getitem__(self, key: str) -> types.AttributeValue:
163166
return self._dict[key]
164167

165168
def __setitem__(self, key: str, value: types.AttributeValue) -> None:
@@ -179,10 +182,10 @@ def __setitem__(self, key: str, value: types.AttributeValue) -> None:
179182
):
180183
if not isinstance(self._dict, OrderedDict):
181184
self._dict = OrderedDict(self._dict)
182-
self._dict.popitem(last=False) # type: ignore
185+
self._dict.popitem(last=False) # type: ignore
183186
self.dropped += 1
184187

185-
self._dict[key] = value # type: ignore
188+
self._dict[key] = value # type: ignore
186189

187190
def __delitem__(self, key: str) -> None:
188191
if getattr(self, "_immutable", False): # type: ignore

0 commit comments

Comments
 (0)