aboutcode-org / aboutcode-org/scancode-toolkit
TypeError: unhashable type: 'License'
未关闭
bug
- 主要语言
- Python
- 星标
- 2.6k
- 派生
- 791
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 5
描述
I would like to get a set of unique `licensedcode.models.License` objects but this model is missing the `__hash__` required for this purpose. Since the `key` field is unique, I'm guessing it could be use for the hash.
Note that this behavior is properly implemented for the `license_expression.LicenseSymbol` but not once we go down to the actual `License` objects.
```
>>> from licensedcode.models import License
>>> set([License(key="k1"), License(key="k1"), License(key="k2")])
Traceback (most recent call last):
File "", line 1, in
TypeError: unhashable type: 'License'
```
贡献指南
评估
这个 Issue 还没有评估数据。