Generic class with broken `__eq__` cannot be specialized
Đang mở
@JelleZijlstra đang làm issue này rồi.
Từ ngày 3/6/2024.
3.12
3.13
3.14
topic-typing
type-bug
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Bug report
Bug description:
This test case currently fails:
def test_buggy_eq(self):
class BrokenEq(abc.ABCMeta):
def __eq__(self, other):
raise TypeError("I'm broken")
class G(Generic[T], metaclass=BrokenEq):
pass
alias = G[int]
self.assertIs(get_origin(alias), G)
self.assertEqual(get_args(alias), (int,))
See python/typing_extensions#422 for a real-world example.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-119973
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.