Skip to content

Commit 7a38347

Browse files
docs(baggage): Document that caller must check mutable (#4010)
The `Baggage` class does not enforce mutability. Document this to avoid confusion. <!-- Describe your PR here --> --- Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`. Running the test suite on your PR might require maintainer approval. The AWS Lambda tests additionally require a maintainer to add a special label, and they will fail until this label is added. Co-authored-by: Anton Pirker <[email protected]>
1 parent 5771f3e commit 7a38347

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,10 @@ def _sample_rand(self):
543543
class Baggage:
544544
"""
545545
The W3C Baggage header information (see https://www.w3.org/TR/baggage/).
546+
547+
Before mutating a `Baggage` object, calling code must check that `mutable` is `True`.
548+
Mutating a `Baggage` object that has `mutable` set to `False` is not allowed, but
549+
it is the caller's responsibility to enforce this restriction.
546550
"""
547551

548552
__slots__ = ("sentry_items", "third_party_items", "mutable")

0 commit comments

Comments
 (0)