Should __init__.py imports be treated as exports with --no-implicit-reexport behaviour?
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
I'm uncertain whether --no-implicit-reexport has a "correct" behaviour when it comes to __init.py__ files.
If I have this __init__.py file:
from .mysub import MyName
My intent is to export MyName from the module. Currently this does not work however, and I need to do either:
from .mysub import MyName as MyName
or
from .mysub import MyName
__all__ = ['MyName']
Both of which are redundant.
I saw this issue on stub-generation that seems to imply that imports in an init (or otherwise unused imports) should be considered exports.
Shouldn't --no-implicit-reexport treat init files as doing exports for the module without the code having to use the redundant ...as... or __all__ form?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue にはリポジトリのファイルやテストが記載されていません。まず --no-implicit-reexport の実装とテストを見つけ、次にリンクされている stub-generation issue と init.py の例を確認してください。冗長な構文なしで、そのような import が export であるかどうかについて決定されたルールを確立し、実装できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100