Generic MRO
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
首先閱讀提議的 generic_mro API 和相關 issue #776;該 issue 沒有指出任何實作檔案或測試。完成的標準是提供提議的函式,並符合針對 C、B 和 B[int] 所記錄的三個 MRO 結果。
由索引模型根據 Issue 內容生成。
描述
Generic information are lost with classes __mro__. But it could be useful to have it, especially for #776 implementation.
typing module could integrate a generic_mro function in order to retrieve the class MRO annotated with related generic information; this function could also accept a generic alias in argument.
from typing import Generic, TypeVar, generic_mro
T = TypeVar("T")
class A(Generic[T]): ...
U = TypeVar("U")
class B(A[U]): ...
class C(B[int]):
pass
assert generic_mro(C) == (C, B[int], A[int], Generic, object)
assert generic_mro(B) == (B, A[U], Generic, object)
assert generic_mro(B[int]) == (B[int], A[int], Generic, object)
- 主要語言
- Python
- 星號
- 1.8k
- 分支
- 302
- 平均合併
- 4 小時 16 分鐘
- 30 天內合併 PR
- 7
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/typing 的其他 Issue
-
topic: typing spec
難度 2/5 1-3 小時 新手友好度 72/100
python/typing#2356 · 2 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
topic: typing spec
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
topic: documentation
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
topic: documentation
難度 2/5 1-3 小時 新手友好度 65/100
python/typing#2150 · 2 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
topic: conformance tests topic: typing spec
難度 3/5 1-2 天 新手友好度 72/100
維護者通常 1 天內回覆
相似的 Issue
-
tool-calling
難度 2/5 1-3 小時 新手友好度 88/100
vllm-project/vllm#59838 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 92/100
raullenchai/Rapid-MLX#4042 ·
維護者通常 1 天內回覆
-
documentation
難度 1/5 1 小時以內 新手友好度 92/100
transitmatters/mbta-slow-zone-bot#70 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
litestar-org/advanced-alchemy#811 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆