mbr / simplekv

A simple key-value store for binary data.
http://simplekv.readthedocs.io
MIT License
152 stars 50 forks source link

Delete memcached backend & enforce unicode keys #45

Closed criemen closed 7 years ago

criemen commented 7 years ago

Hi,

this PR contains the most critical changes for the next version, as they are breaking backwards compatibility. Dropping the memcached backend has a clear scope and ramifications, for the unicode change this is less clear. The test code mixed unicode- and nonunicode keys all over the place (except for python 3, where all string constants also were interpreted as unicode strings), never being totally clear which strings were supposed to be unicode strings and which were byte strings. Together with PR #42 this will enforce the correct string types throughout the API.

fmarczin commented 7 years ago

Since there already is a _compat module, I would suggest adding something like this to it and avoid the extra dependency on six:

if not PY2:
    text_type = str
    unichr = chr
    binary_type = bytes
else:
    text_type = unicode
    unichr = unichr
    binary_type = str
criemen commented 7 years ago

wrt six/_compat: you are right, this is addressed with the new commits.

criemen commented 7 years ago

@mbr can you please sign this off, as these constitute breaking changes for the users?

criemen commented 7 years ago

due to a wrong push, this was marked as merged, I reset the branch... Sorry!