Skip to content

Commit 85f4bbc

Browse files
docs(scope): Add docstring to Scope.set_tags
1 parent 538871c commit 85f4bbc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sentry_sdk/scope.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,21 @@ def set_tag(self, key, value):
851851

852852
def set_tags(self, tags):
853853
# type: (Mapping[str, object]) -> None
854+
"""Sets multiple tags at once.
855+
856+
This method updates multiple tags at once. The tags are passed as a dictionary
857+
or other mapping type.
858+
859+
Calling this method is equivalent to calling `set_tag` on each key-value pair
860+
in the mapping. If a tag key already exists in the scope, its value will be
861+
updated. If the tag key does not exist in the scope, the key-value pair will
862+
be added to the scope.
863+
864+
This method only modifies tag keys in the `tags` mapping passed to the method.
865+
`scope.set_tags({})` is, therefore, a no-op.
866+
867+
:param tags: A mapping of tag keys to tag values to set.
868+
"""
854869
self._tags.update(tags)
855870

856871
def remove_tag(self, key):

0 commit comments

Comments
 (0)