Skip to content

Commit

Permalink
Update usage.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
TravellerXi authored and Sekenre committed Jun 1, 2023
1 parent 8c9a6f4 commit 2bd6695
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Basic usage

Serializing and deserializing with cbor2 is pretty straightforward::

from cbor2 import dumps, loads
from cbor2 import dumps, loads, load

# Serialize an object as a bytestring
data = dumps(['hello', 'world'])
Expand All @@ -12,6 +12,7 @@ Serializing and deserializing with cbor2 is pretty straightforward::
obj = loads(data)

# Efficiently deserialize from a file
with open('input.cbor', 'rb') as fp:
obj = load(fp)

Expand Down

0 comments on commit 2bd6695

Please sign in to comment.