Before this patch, both bytes and str were encoded as mp_str. It was
possible to work with utf and non-utf strings, but not with
varbinary (mp_bin) [1]. This patch adds varbinary support for Python 3
by default. With Python 2 the behavior of the connector remains the same.
Before this patch:
encoding="utf-8" (default)
Python 3
->
Tarantool
->
Python 3
str
->
mp_str (string)
->
str
bytes
->
mp_str (string)
->
str
mp_bin (varbinary)
->
bytes
encoding=None
Python 3
->
Tarantool
->
Python 3
bytes
->
mp_str (string)
->
bytes
str
->
mp_str (string)
->
bytes
mp_bin (varbinary)
->
bytes
Using bytes as key was not supported by several methods (delete,
update, select).
After this patch:
encoding="utf-8" (default)
Python 3
->
Tarantool
->
Python 3
str
->
mp_str (string)
->
str
bytes
->
mp_bin (varbinary)
->
bytes
encoding=None
Python 3
->
Tarantool
->
Python 3
bytes
->
mp_str (string)
->
bytes
str
->
mp_str (string)
->
bytes
mp_bin (varbinary)
->
bytes
Using bytes as key are now supported by all methods.
Thus, encoding="utf-8" connection may be used to work with
utf-8 strings and varbinary and encodine=None connection
may be used to work with non-utf-8 strings.
This patch does not add new restrictions (like "do not permit to use
str in encoding=None mode because result may be confusing") to preserve
current behavior (for example, using space name as str in schema
get_space).
Merge after #213
This is a breaking change.
Before this patch, both bytes and str were encoded as mp_str. It was possible to work with utf and non-utf strings, but not with varbinary (mp_bin) [1]. This patch adds varbinary support for Python 3 by default. With Python 2 the behavior of the connector remains the same.
Before this patch:
encoding=None
Using bytes as key was not supported by several methods (delete, update, select).
After this patch:
encoding="utf-8" (default)
encoding=None
Using bytes as key are now supported by all methods.
Thus, encoding="utf-8" connection may be used to work with utf-8 strings and varbinary and encodine=None connection may be used to work with non-utf-8 strings.
This patch does not add new restrictions (like "do not permit to use str in encoding=None mode because result may be confusing") to preserve current behavior (for example, using space name as str in schema get_space).
Closes #105