lericson/pylibmc — pull request #162 by hfalcic (2014-09-13 15:26:03+00:00)
Title: Match key types

This should fix #158 by matching the types of each key passed in, even with *mixed key types*.

`test.py`:
```
#!/usr/bin/env python3
import pylibmc

c = pylibmc.Client(['127.0.0.1'])
# Three keys.
# 1. 'a', given as text
# 2. U+FFFD REPLACEMENT CHARACTER, given as text
# 3. U+1F4A3 BOMB, given as UTF-8 bytes
c.set_multi({'a': 1, '\ufffd': 'r', b'\xf0\x9f\x92\xa3': 'bomb'})
# Swap the types for the second two items: use a byte string
# for the replacement character, and a text string for 'bomb'
print(c.get_multi(['a', b'\xef\xbf\xbd', '\U0001f4ac']))
```

Output:
```
{b'a': 1, '💣': 'bomb', b'\xef\xbf\xbd': 'r'}
```