Skip to content

Commit 82fdb63

Browse files
szokeasaurusrexarjenzorgdoc
authored andcommitted
ref(scope): Broaden add_attachment type (getsentry#3342)
Update the type hint to clarify that `add_attachment`'s `bytes` parameter can also accept `Callable[[], bytes]` values, since it gets passed through to the `Attachment` constructor, which accepts such values.
1 parent 0a49036 commit 82fdb63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ def clear_breadcrumbs(self):
893893

894894
def add_attachment(
895895
self,
896-
bytes=None, # type: Optional[bytes]
896+
bytes=None, # type: Union[None, bytes, Callable[[], bytes]]
897897
filename=None, # type: Optional[str]
898898
path=None, # type: Optional[str]
899899
content_type=None, # type: Optional[str]

0 commit comments

Comments
 (0)