Skip to content

Commit

Permalink
improve wording of readme and msgpack.org.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vsergeev committed Sep 25, 2016
1 parent 81911b3 commit 10c50a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ OrderedDict([('compact', True), ('schema', 0)])

### Compatibility Mode

u-msgpack-python offers a compatibility mode for the [old specification](https://github.com/msgpack/msgpack/blob/master/spec-old.md) to handle the old "raw" bytes msgpack type. When the compatibility mode is enabled, u-msgpack-python will serialize both unicode strings and bytes into the old "raw" msgpack type, and deserialize the "raw" msgpack type into bytes. To enable compatibility mode, simply set the `compatibility` boolean of the umsgpack module to `True`.
The compatibility mode supports the "raw" bytes MessagePack type from the [old specification](https://github.com/msgpack/msgpack/blob/master/spec-old.md). When the module-wide `compatibility` option is enabled, both unicode strings and bytes will be serialized into the "raw" MessagePack type, and the "raw" MessagePack type will be deserialized into bytes.

``` python
>>> umsgpack.compatibility = True
Expand Down Expand Up @@ -238,7 +238,7 @@ If a non-byte-string argument is passed to `umsgpack.unpackb()`, it will raise a

* `UnhashableKeyException`: Unhashable key encountered during map unpacking. The packed map cannot be unpacked into a Python dictionary.

Python dictionaries only support keys that are instances of `collections.Hashable`, so while the map `{ { u'abc': True } : 5 }` has a msgpack encoding, it cannot be unpacked into a valid Python dictionary.
Python dictionaries only support keys that are instances of `collections.Hashable`, so while the map `{ { u'abc': True } : 5 }` has a MessagePack encoding, it cannot be unpacked into a valid Python dictionary.

``` python
# Attempt to unpack { {} : False }
Expand All @@ -250,7 +250,7 @@ If a non-byte-string argument is passed to `umsgpack.unpackb()`, it will raise a

* `DuplicateKeyException`: Duplicate key encountered during map unpacking.

Python dictionaries do not support duplicate keys, but msgpack maps may be encoded with duplicate keys.
Python dictionaries do not support duplicate keys, but MessagePack maps may be encoded with duplicate keys.

``` python
# Attempt to unpack { 1: True, 1: False }
Expand All @@ -275,7 +275,7 @@ If a non-byte-string argument is passed to `umsgpack.unpackb()`, it will raise a

## Testing

u-msgpack-python's included unit tests may be run with `test_umsgpack.py`, under your favorite interpreter.
The included unit tests may be run with `test_umsgpack.py`, under your favorite interpreter.

``` text
$ python2 test_umsgpack.py
Expand Down
2 changes: 1 addition & 1 deletion msgpack.org.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ available:

## More Information

See the [project page](https://github.com/vsergeev/u-msgpack-python) for more information on old specification compatibility mode, exceptions, behavior, and testing.
See the [project page](https://github.com/vsergeev/u-msgpack-python) for more information on options, exceptions, behavior, and testing.

## License

Expand Down

0 comments on commit 10c50a8

Please sign in to comment.