Make a Converter without the default hook factories
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
The payload names no files. Start with the fallback-hook-factories section of the docs and the unstructure_fallback_factory and structure_fallback_factory arguments of Converter, to see how a child converter consults its parent. Then check why the default structure_attrs_fromdict preference overrides the parent's hook. The issue is open on which approach to take (a BaseConverter workaround or new __init__ flags), so agree on a design with maintainers first. Done means a child converter uses a hook registered on its parent even when a default hook exists.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The problem
Let's take the fallback-hook-factories section
parent = Converter()
child = Converter(
unstructure_fallback_factory=parent.get_unstructure_hook,
structure_fallback_factory=parent.get_structure_hook,
)
Let's say in parent you added another custom hook factory such as
@parent.register_structure_hook_factory(lambda val: issubclass(val, Foo))
def structure_Foo(cls) -> StructureHook:
...
You would expect that the child would pick up this new converter of the parent, but that is not the case if there is already a way to structure Foo from the default converters in Converter
So what now?
One way around this is to use BaseConverter I guess, but it is not quite that straightforward and trying it out I still hit some other preferences that override it, e.g. structure_attrs_fromdict.
Another option would be to have flags in the __init__ of those converters to truely not add any defaults and let it fallback to the parent more directly.
- Ngôn ngữ chính
- Python
- Star
- 1.1k
- Fork
- 171
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của python-attrs/cattrs
-
decimal.Decimal not handled in preconf converters (json, pyyaml)Có thể đã có người làm @Binilkks đã nhận 111 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
python-attrs/cattrs#761 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
python-attrs/cattrs#513 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Getting the next structure hookĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
python-attrs/cattrs#794 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 85/100
python-attrs/cattrs#774 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
python-attrs/cattrs#746 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của python-attrs/cattrs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
common-workflow-language/cwl-utils#477 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add dependabotĐang mởfeat
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
open-nudge/opentemplate#204 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limitCó thể đã có người làm @VascoSch92 đã nhận hôm nay. Đang mởpriority:medium ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenHands/extensions#781 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
githubnext/gh-aw-workshop#4638 ·
Maintainer thường phản hồi trong vòng 1 ngày