Skip to content

Commit 17e46a3

Browse files
committed
Also suggest usage with real files in doc
1 parent 155cf89 commit 17e46a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/userguide.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ In such case :class:`depot.io.utils.FileIntent` can be provided to DEPOT instead
117117
content_type to use to store the file. Also non files can be provided to FileIntent to store raw
118118
data::
119119

120+
# Works with file objects
121+
file_id = self.fs.create(
122+
FileIntent(open('/tmp/file', 'rb'), 'file.txt', 'text/plain')
123+
)
124+
125+
# Works also with bytes
120126
file_id = self.fs.create(
121127
FileIntent(b'HELLO WORLD', 'file.txt', 'text/plain')
122128
)

0 commit comments

Comments
 (0)