Skip to content

Commit

Permalink
docs(baggage): Document that caller must check mutable
Browse files Browse the repository at this point in the history
The `Baggage` class does not enforce mutability. Document this to avoid confusion.
  • Loading branch information
szokeasaurusrex committed Jan 31, 2025
1 parent 8c25c73 commit f5c872a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sentry_sdk/tracing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ def __repr__(self):
class Baggage:
"""
The W3C Baggage header information (see https://www.w3.org/TR/baggage/).
Before mutating a `Baggage` object, calling code must check that `mutable` is `True`.
Mutating a `Baggage` object that has `mutable` set to `False` is not allowed, but
it is the caller's responsibility to enforce this restriction.
"""

__slots__ = ("sentry_items", "third_party_items", "mutable")
Expand Down

0 comments on commit f5c872a

Please sign in to comment.