Skip to content

Commit 9b67327

Browse files
committed
strict_types should be last argument
1 parent 1032ef9 commit 9b67327

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

msgpack/_packer.pyx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ cdef class Packer(object):
5555
Convert unicode to bytes with this encoding. (default: 'utf-8')
5656
:param str unicode_errors:
5757
Error handler for encoding unicode. (default: 'strict')
58-
:param bool strict_types:
59-
If set to true, types will be checked to be exact. Derived classes
60-
from serializeable types will not be serialized and will be
61-
treated as unsupported type and forwarded to default.
62-
Additionally tuples will not be serialized as lists.
63-
This is useful when trying to implement accurate serialization
64-
for python types.
6558
:param bool use_single_float:
6659
Use single precision float type for float. (default: False)
6760
:param bool autoreset:
@@ -70,6 +63,13 @@ cdef class Packer(object):
7063
:param bool use_bin_type:
7164
Use bin type introduced in msgpack spec 2.0 for bytes.
7265
It also enable str8 type for unicode.
66+
:param bool strict_types:
67+
If set to true, types will be checked to be exact. Derived classes
68+
from serializeable types will not be serialized and will be
69+
treated as unsupported type and forwarded to default.
70+
Additionally tuples will not be serialized as lists.
71+
This is useful when trying to implement accurate serialization
72+
for python types.
7373
"""
7474
cdef msgpack_packer pk
7575
cdef object _default

msgpack/fallback.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,6 @@ class Packer(object):
608608
Convert unicode to bytes with this encoding. (default: 'utf-8')
609609
:param str unicode_errors:
610610
Error handler for encoding unicode. (default: 'strict')
611-
:param bool strict_types:
612-
If set to true, types will be checked to be exact. Derived classes
613-
from serializeable types will not be serialized and will be
614-
treated as unsupported type and forwarded to default.
615-
Additionally tuples will not be serialized as lists.
616-
This is useful when trying to implement accurate serialization
617-
for python types.
618611
:param bool use_single_float:
619612
Use single precision float type for float. (default: False)
620613
:param bool autoreset:
@@ -623,10 +616,17 @@ class Packer(object):
623616
:param bool use_bin_type:
624617
Use bin type introduced in msgpack spec 2.0 for bytes.
625618
It also enable str8 type for unicode.
619+
:param bool strict_types:
620+
If set to true, types will be checked to be exact. Derived classes
621+
from serializeable types will not be serialized and will be
622+
treated as unsupported type and forwarded to default.
623+
Additionally tuples will not be serialized as lists.
624+
This is useful when trying to implement accurate serialization
625+
for python types.
626626
"""
627627
def __init__(self, default=None, encoding='utf-8', unicode_errors='strict',
628-
strict_types=False, use_single_float=False, autoreset=True,
629-
use_bin_type=False):
628+
use_single_float=False, autoreset=True, use_bin_type=False,
629+
strict_types=False):
630630
self._strict_types = strict_types
631631
self._use_float = use_single_float
632632
self._autoreset = autoreset

0 commit comments

Comments
 (0)