コード例 #1
0
def zset_score_pairs(response, **options):
    """
    If ``withscores`` is specified in the options, return the response as
    a list of (value, score) pairs
    """
    if not response or not options['withscores']:
        return response
    it = iter(response)
    return list(izip(it, imap(int, it)))
コード例 #2
0
ファイル: client.py プロジェクト: Eddie0330/ledisdb
def zset_score_pairs(response, **options):
    """
    If ``withscores`` is specified in the options, return the response as
    a list of (value, score) pairs
    """
    if not response or not options['withscores']:
        return response
    it = iter(response)
    return list(izip(it, imap(int, it)))
コード例 #3
0
def pairs_to_dict(response):
    "Create a dict given a list of key/value pairs"
    it = iter(response)
    return dict(izip(it, it))
コード例 #4
0
ファイル: client.py プロジェクト: Gohan/ledisdb
def pairs_to_dict(response):
    "Create a dict given a list of key/value pairs"
    it = iter(response)
    return dict(izip(it, it))