aboutcode-org / aboutcode-org/scancode-toolkit

TypeError: unhashable type: 'License'

Đang mở
#3,425 0 bình luận 0 reaction 1 người được giao Được @AyanSinhaMahapatra nhận Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
2.6k
Fork
791
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

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'
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.