From 2bd66950e0cc585332d5dbfea87d3ad3aa62ba7d Mon Sep 17 00:00:00 2001 From: Traveller <51471579+TravellerXi@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:52:36 +0100 Subject: [PATCH] Update usage.rst --- docs/usage.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage.rst b/docs/usage.rst index 5edeabd6..8be27a81 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -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']) @@ -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)