Skip to content

Commit

Permalink
README: update examples to match API changes from 0.4.0
Browse files Browse the repository at this point in the history
The calls in the README were not updated in commit
b969c67, so they were incorrect.

Fixes #13
  • Loading branch information
dcbaker committed Sep 8, 2017
1 parent a1acd4e commit 89b724a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ Basic Usage
A simple example looks like this

.. code-block:: python
import jsonstreams
with jsonstreams.Stream('foo', jsonstreams.Type.object) as s:
with jsonstreams.Stream(jsonstreams.Type.object, filename='foo') as s:
s.write('foo', 'bar')
with s.subobject('a') as a:
a.write(1, 'foo')
Expand All @@ -64,9 +66,11 @@ is unnecessary:

.. code-block:: python
import jsonstreams
mylist = list(range(10))
mydict = {a: b for a in range(10) for b in 'abcdefghij'}
with jsonstreams.Stream('foo', jsonstreams.Type.object) as s:
with jsonstreams.Stream(jsonstreams.Type.object, filename='foo') as s:
s.write('list', mylist)
s.write('dict', mydict)

0 comments on commit 89b724a

Please sign in to comment.