[spec] Clarification: Are symbols not listed in `__all__` ever considered public?
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.8k
- フォーク
- 302
- 平均マージ
- 23時間
- マージ済み PR(30日)
- 8
説明
According to https://typing.readthedocs.io/en/latest/guides/libraries.html#library-interface-public-and-private-symbols:
A module can expose an
__all__symbol at the module level that provides a list of names that are considered part of the interface. This overrides all other rules above, allowing imported symbols or symbols whose names begin with an underscore to be included in the interface.
Does this mean that if __all__ is present: ① A symbol is public if and only if it is listed in __all__ or ② If a symbol is listed in __all__, it is public, but things not listed in __all__ can still be considered public as well?
For example:
# module.py
__all__ = ["identity"]
from typing import TypeVar
T = TypeVar("T")
def identity(x: T) -> T:
return x
Are TypeVar and T considered public members of module.py? If so, what is the suggested way to exclude them? T could be renamed to _T, but is one supposed to do from typing import TypeVar as _TypeVar, if one wants TypeVar to not be considered a public member of module?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている「Library Interface: Public and Private Symbols」ガイドから始め、その all に関する記述を、issue の module.py の例と比較してください。インポートされた名前と TypeVar 宣言を適切な場合にどのように除外すべきかも含め、公開シンボルの動作がドキュメントで明確になれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100