[FEATURE REQUEST] typed arguments
未關閉
enhancement
- 主要語言
- Python
- 星號
- 28.2k
- 分支
- 1.5k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
If I write a typed variable argument, I am expecting an argument of a specific type.
Example:
```python
import fire
def test(some_str: str):
print(some_str)
if __name__ == "__main__":
fire.Fire()
```
Real result:
```shell
python test.py test 7.30
7.3
```
Expected Result:
```shell
python test.py test 7.30
7.30
```
So this feature will not break [argument parsing](https://github.com/google/python-fire/blob/master/docs/guide.md#argument-parsing). The typed argument should be enough to detect the real type.
貢獻指南
研究方向
重現 issue 中的型別化引數範例,接著閱讀 docs/guide.md 中關於引數解析的段落,並追蹤其中描述的 parser 進入點。完成的標準是:型別化的可變引數遵循所要求的型別行為,同時不破壞現有的引數解析,並且有一個回歸測試涵蓋所示命令。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- cli
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 32/100