EnumType __call__ method description does not match the implementation
Đang mở
@ethanfurman đang làm issue này rồi.
Từ ngày 17/5/2024.
docs
stdlib
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Documentation
See EnumType.call documentation, where the prototype is:
__call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
While in the enum.py source code there is:
def __call__(cls, value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None):
-
The
_not_givenhelper behaves differently thanNone, which even breaks compatibility with previous versions (this change was introduced in 3.12.3), when one needs to do some customization of enum metaclass.- e.g. as propsed on the stack overflow to implement enum item deprecation warning - note that this implementation stops working in 3.12.3 since the call of the parent
EnumType.__call__passesNoneinstead of_not_givenand it causes different behavior.
- e.g. as propsed on the stack overflow to implement enum item deprecation warning - note that this implementation stops working in 3.12.3 since the call of the parent
-
Note
*vs.*values, which I believe even behaves differently.
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á.