Upgrade `typing.type_check_only` to be applicable to variables(and maybe import statements)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
先檢視針對變數和匯入陳述式所要求的 typing.type_check_only 行為,然後閱讀關於 stub 中虛構模組匯入的相關 issue #11503。只有在所需的、僅於型別檢查時生效的語意以及匯入行為都已明確規範並取得共識後,才算完成。
由索引模型根據 Issue 內容生成。
描述
from typing import _KT, _promote
Success: no issues found in 1 source file
Sure it has an underscore, but seems super sus that there is no mechanism to specify that a variable in a stub is just a type time helper and has no bearing on reality whatsoever.
You can specify explicitly that an import is accessible by importing it with an alias, although this in itself looks extremely hacky/workaroundy.
Also if it were possible to mark something in a stub as 'type time' only, then you could remove all the underscores and make a bunch of types look a lot nicer.
Very much related to https://github.com/python/mypy/issues/11503, where a module import in a stub can be completely fictitious, and there is currently no way to specify it one way or the other.
- 主要語言
- 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
-
P4: low tooling
難度 2/5 1-3 小時 新手友好度 88/100
jeffknupp/association#318 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
petercorke/robotics-toolbox-python#709 ·
維護者通常 2 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 88/100
MakerYuichi/Aegis-pro#114 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
mpfaffenberger/code_puppy#985 · 2 則留言 ·
維護者通常 1 天內回覆