advanced SimpleNamespace typing
還沒有人認領這個 Issue。
評估
研究方向
此 issue 未提供 repository 檔案或測試入口;請先將所要求的巢狀 TypedSimpleNamespace 語義與 PEP 589 TypedDict 進行比較。在尋找實作與測試之前,先釐清所示有效範例與無效範例的型別檢查行為及範圍。
由索引模型根據 Issue 內容生成。
描述
the same way we now have TypedDict, it would be nice to have typed SimpleNamespace with equivalent semantics, so that nested structures can be easily checked. eg
class MySubType(TypedSimpleNamespace):
bar: int
class MyType(TypedSimpleNamespace):
foo: MySubType
# correct
a: MyType = SimpleNamespace(foo=SimpleNamespace(bar=1))
# incorrect, `bar` should be a number
a: MyType = SimpleNamespace(foo=SimpleNamespace(bar='abc'))
- 主要語言
- Python
- 星號
- 1.8k
- 分支
- 302
- 平均合併
- 23 小時
- 30 天內合併 PR
- 8
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/typing 的其他 Issue
-
topic: typing spec
難度 2/5 1-3 小時 新手友好度 72/100
-
topic: typing spec
難度 2/5 1-3 小時 新手友好度 75/100
-
topic: documentation
難度 2/5 1-3 小時 新手友好度 76/100
-
topic: documentation
難度 2/5 1-3 小時 新手友好度 65/100
-
topic: conformance tests topic: typing spec
難度 3/5 1-2 天 新手友好度 72/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main 未關閉area: ci bug perceived difficulty: 3
難度 2/5 1-3 小時 新手友好度 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
難度 1/5 1 小時以內 新手友好度 92/100
-
難度 2/5 1-3 小時 新手友好度 78/100
ClickHouse/clickhouse-connect#1057 ·