Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#411 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
cli

调研方向

首先通过 tmp.py 的 main 函数和 fire.Fire 入口点重现这些命令,并比较 tmp,0、tmp,01 和 tmp,0tmp 的输出。跟踪参数解析行为,并将 done 定义为:一致地处理字符串列表,不进行意外的类型转换或字符拆分。

由索引模型根据 Issue 内容生成。

描述

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

# 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', <class 'str'>), (0, <class 'int'>)]

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

> python tmp.py --keyword_list=tmp,0tmp
[('t', <class 'str'>), ('m', <class 'str'>), ('p', <class 'str'>), (',', <class 'str'>), ('0', <class 'str'>), ('t', <class 'str'>), ('m', <class 'str'>), ('p', <class 'str'>)]
主要语言
Python
星标
28.2k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/python-fire 的其他 Issue

查看 google/python-fire 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。