google / google/python-fire

Unexpected parsing behaviour for List of strings containing a string with a numeric initial

未關閉
#411 1 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
28.2k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

描述

This is just a report. I hope it will be useful for development. I'm using fire v0.4.0.

```python
# tmp.py
import fire
def main(keyword_list):
print([(keyword,type(keyword)) for keyword in keyword_list])
fire.Fire(main)
```
Will give you:
```
> python tmp.py --keyword_list=tmp,0
[('tmp', ), (0, )]

> python tmp.py --keyword_list=tmp,01
[('t', ), ('m', ), ('p', ), (',', ), ('0', ), ('1', )]

> python tmp.py --keyword_list=tmp,0tmp
[('t', ), ('m', ), ('p', ), (',', ), ('0', ), ('t', ), ('m', ), ('p', )]
```

貢獻指南

開啟貢獻指南

研究方向

首先透過 tmp.py 的 main 函式和 fire.Fire 進入點重現這些命令,並比較 tmp,0、tmp,01 和 tmp,0tmp 的輸出。追蹤引數解析行為,並將 done 定義為:一致地處理字串清單,不進行非預期的型別轉換或字元拆分。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。