dataclass with slots=True, init=False raises AttributeError
Đang mở
@ericvsmith đang làm issue này rồi.
Từ ngày 30/10/2022.
stdlib
topic-dataclasses
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ả
Python 3.10.4
dataclass with slots=True, init=False raises AttributeError on attribute access
from dataclasses import dataclass
@dataclass(slots=True, init=False)
class WorldState:
is_mission_running: bool = False
w = WorldState()
w.is_mission_running
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'WorldState' object has no attribute 'is_mission_running'
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á.