(prefix="", strip_prefix=False)
| 5 | |
| 6 | |
| 7 | def iterkeys(prefix="", strip_prefix=False): |
| 8 | decode = lambda s: s # noqa: E731 |
| 9 | if isinstance(prefix, six.text_type): |
| 10 | prefix = prefix.encode("utf-8") |
| 11 | decode = lambda s: s.decode("utf-8") # noqa: E731 |
| 12 | |
| 13 | for i in six.moves.range(count()): |
| 14 | key = key_by_index(i) |
| 15 | if key.startswith(prefix): |
| 16 | if strip_prefix: |
| 17 | key = key[len(prefix) :] |
| 18 | yield decode(key) |
| 19 | |
| 20 | |
| 21 | def itervalues(prefix=b""): |