document typing.Literal in function/method arguments
Maintainer thường phản hồi trong vòng 1 ngày
@has2k1 đang làm issue này rồi.
Từ ngày 19/11/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- documentation
Hướng nghiên cứu
Start by reading the code that builds function and method signatures for generated documentation, then find its tests for type annotations. Add support for displaying the values from typing.Literal, including None when the annotation is optional. Done looks like generated signatures show the available options and the relevant tests cover this example.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prework
- Read and abide by the Great Docs code of conduct and contributing guidelines.
- Search for duplicates among the existing issues (both open and closed).
Proposal
I have functions/methods I want to document that have Literal type annotations, for example:
def do_thing(word: str, projection: Literal["standard", "full"] | None = None) -> dict:
"""Docstring Example"""
return {}
When I generate docs, it looks like this:
do_thing(
word,
projection=None,
)
This isn't ideal - I'd like to to be able to document to a user what the available options are for projection. Could this be updated to show the available options?
Something like this, though it could be flexible:
do_thing(
word,
projection: {None, "standard", "full"} = None,
)
- Ngôn ngữ chính
- Python
- Star
- 282
- Fork
- 24
- Merge trung bình
- 2 giờ 17 phút
- Pull request đã merge (30 ngày)
- 281
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 posit-dev/great-docs
-
Potential problem with versioned documentationCó thể đã có người làm @has2k1 đã nhận 3 ngày trước. Đang mởDifficulty: [3] Advanced Effort: [3] High Priority: ♨︎ Critical Type: ✎ Docs
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 45/100
posit-dev/great-docs#774 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: ★ Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
posit-dev/great-docs#353 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Citation anchors collide and references resolve to the wrong targetCó thể làm lại được @has2k1 đã nhận 94 ngày trước và không có pull request nào đang mở. Đang mởDifficulty: [3] Advanced Priority: [1] Low Type: ☹︎ Bug
posit-dev/great-docs#334 · 1 người được giao ·
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 25/100
posit-dev/great-docs#330 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Customization options to replicate Quarto appearanceCó thể làm lại được @has2k1 đã nhận 94 ngày trước và không có pull request nào đang mở. Đang mởDifficulty: [3] Advanced Effort: [3] High Priority: [3] High Type: ★ Enhancement
posit-dev/great-docs#328 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của posit-dev/great-docs
Issue tương tự
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobĐang mởaccepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
future-agi/future-agi#6392 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdCó thể đã có người làm @prathameshfuke đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
StingraySoftware/HENDRICS#213 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ 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 2 ngày
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Độ 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