Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9e2304

Browse files
author
Mark Summerfield
committed
dumps() and loads() work in terms of bytes objects not strings.
1 parent e57950f commit b9e2304

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Doc/library/pickle.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,18 @@ process more convenient:
194194

195195
.. function:: dumps(obj[, protocol])
196196

197-
Return the pickled representation of the object as a string, instead of writing
198-
it to a file.
197+
Return the pickled representation of the object as a :class:`bytes`
198+
object, instead of writing it to a file.
199199

200200
If the *protocol* parameter is omitted, protocol 3 is used. If *protocol*
201201
is specified as a negative value or :const:`HIGHEST_PROTOCOL`, the highest
202202
protocol version will be used.
203203

204204

205-
.. function:: loads(string)
205+
.. function:: loads(bytes_object)
206206

207-
Read a pickled object hierarchy from a string. Characters in the string past
208-
the pickled object's representation are ignored.
207+
Read a pickled object hierarchy from a :class:`bytes` object.
208+
Bytes past the pickled object's representation are ignored.
209209

210210
The :mod:`pickle` module also defines three exceptions:
211211

0 commit comments

Comments
 (0)