首页 > 解决方案 > 将元组传递给frozenset

问题描述

我有这个tuple

t = (
    {
        "path": "/api/",
        "uuid": "068aebae",
        "params": {
            "name": "foobar",
        },
        "response": {"is_true": False},
        "content": "bar",
    },
)

我想传递给frozenset

>>> frozenset(d)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'dict'

我怎样才能做到这一点?

标签: python

解决方案


推荐阅读