Skip to content

Commit ab11fb7

Browse files
docs(scope): Add docstring to Scope.set_tags
1 parent 689fab5 commit ab11fb7

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
@@ -801,6 +801,21 @@ def set_tag(self, key, value):
801801

802802
def set_tags(self, tags):
803803
# type: (Mapping[str, object]) -> None
804+
"""Sets multiple tags at once.
805+
806+
This method updates multiple tags at once. The tags are passed as a dictionary
807+
or other mapping type.
808+
809+
Calling this method is equivalent to calling `set_tag` on each key-value pair
810+
in the mapping. If a tag key already exists in the scope, its value will be
811+
updated. If the tag key does not exist in the scope, the key-value pair will
812+
be added to the scope.
813+
814+
This method only modifies tag keys in the `tags` mapping passed to the method.
815+
`scope.set_tags({})` is, therefore, a no-op.
816+
817+
:param tags: A mapping of tag keys to tag values to set.
818+
"""
804819
self._tags.update(tags)
805820

806821
def remove_tag(self, key):

0 commit comments

Comments
 (0)