Skip to content

Commit a65f74a

Browse files
ref(scope): Broaden add_attachment type (#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 d13fe23 commit a65f74a

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)