diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-12-06 22:23:15 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 22:23:15 +0900 |
commit | d8e3cf0563989a660398318a7c788645124e1d8b (patch) | |
tree | bd4db6fa691dd01930e751570bbddb559db1302a /msgpack | |
parent | 0fc0eb2f16fcc7d0271792f93a90af389f66dafb (diff) | |
download | msgpack-python-d8e3cf0563989a660398318a7c788645124e1d8b.tar.gz |
Make strict_map_key default to True (#392)
Diffstat (limited to 'msgpack')
-rw-r--r-- | msgpack/_unpacker.pyx | 8 | ||||
-rw-r--r-- | msgpack/fallback.py | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/msgpack/_unpacker.pyx b/msgpack/_unpacker.pyx index f10e99d..53ecf86 100644 --- a/msgpack/_unpacker.pyx +++ b/msgpack/_unpacker.pyx @@ -131,7 +131,7 @@ cdef inline int get_data_from_buffer(object obj, def unpackb(object packed, *, object object_hook=None, object list_hook=None, - bint use_list=True, bint raw=False, bint strict_map_key=False, + bint use_list=True, bint raw=False, bint strict_map_key=True, unicode_errors=None, object_pairs_hook=None, ext_hook=ExtType, Py_ssize_t max_str_len=-1, @@ -221,9 +221,7 @@ cdef class Unpacker(object): Otherwise, unpack to Python str by decoding with UTF-8 encoding (default). :param bool strict_map_key: - If true, only str or bytes are accepted for map (dict) keys. - It's False by default for backward-compatibility. - But it will be True from msgpack 1.0. + If true (default), only str or bytes are accepted for map (dict) keys. :param callable object_hook: When specified, it should be callable. @@ -305,7 +303,7 @@ cdef class Unpacker(object): self.buf = NULL def __init__(self, file_like=None, *, Py_ssize_t read_size=0, - bint use_list=True, bint raw=False, bint strict_map_key=False, + bint use_list=True, bint raw=False, bint strict_map_key=True, object object_hook=None, object object_pairs_hook=None, object list_hook=None, unicode_errors=None, Py_ssize_t max_buffer_size=0, object ext_hook=ExtType, diff --git a/msgpack/fallback.py b/msgpack/fallback.py index 85a711b..7df92f5 100644 --- a/msgpack/fallback.py +++ b/msgpack/fallback.py @@ -175,9 +175,7 @@ class Unpacker(object): Otherwise, unpack to Python str by decoding with UTF-8 encoding (default). :param bool strict_map_key: - If true, only str or bytes are accepted for map (dict) keys. - It's False by default for backward-compatibility. - But it will be True from msgpack 1.0. + If true (default), only str or bytes are accepted for map (dict) keys. :param callable object_hook: When specified, it should be callable. @@ -249,7 +247,7 @@ class Unpacker(object): read_size=0, use_list=True, raw=False, - strict_map_key=False, + strict_map_key=True, object_hook=None, object_pairs_hook=None, list_hook=None, |