Skip to content

Commit 1ca84f7

Browse files
committed
update CHANGELOG.md and add comment to BoundedAttributes __deepcopy__ implementation
1 parent 9451b89 commit 1ca84f7

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
([#4973](https://github.com/open-telemetry/opentelemetry-python/pull/4973))
2727
- `opentelemetry-exporter-prometheus`: Fix metric name prefix
2828
([#4895](https://github.com/open-telemetry/opentelemetry-python/pull/4895))
29-
- `opentelemetry-api`, `opentelemetry-sdk`: Add deepcopy support for `BoundedAttributes`
29+
- `opentelemetry-api`, `opentelemetry-sdk`: Add deepcopy support for `BoundedAttributes` and `BoundedList`
3030
([#4934](https://github.com/open-telemetry/opentelemetry-python/pull/4934))
3131

3232
## Version 1.40.0/0.61b0 (2026-03-04)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ def __deepcopy__(self, memo: dict) -> "BoundedAttributes":
328328
)
329329
memo[id(self)] = copy_
330330
with self._lock:
331+
# Assign _dict directly to avoid re-cleaning already clean values
332+
# and to bypass the immutability guard in __setitem__
331333
copy_._dict = copy.deepcopy(self._dict, memo)
332334
copy_.dropped = self.dropped
333335
return copy_

0 commit comments

Comments
 (0)