redis里lpush的一个问题,lpush不能传输字典?

用redis储存爬下来的数据的时候遇到一个报错,一直搞不明白,如下:

def save_to_redis(data):
    config = {
        'host': '103.237.184.158',
        'port': 6379,
        'charset': 'utf8'
    }

    r = redis.Redis(**config)
    for item in data:
        r.lpush('InFo', item)

执行了之后报错:
redis.exceptions.DataError: Invalid input of type: 'dict'. Convert to a byte, string or number first.
想请问一下是怎么了

自己搞出来了,加一个str上去就可以了:

def save_to_redis(data):
    config = {
        'host': '127.0.0.1',
        'port': 6379,
        'charset': 'utf8'
    }

    r = redis.Redis(**config)
    # r.set('name', 'tom')
    for item in data:
        r.lpush('InFo', str(item))

这么简单的问题就不麻烦各位大佬了hhhh

为什么会这样,能不能大佬可以解释一下吗,redis不能存字典了嘛