-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
argparse解析参数的错误/bug for argparse #9
Comments
如有必要我可以提交PR修复这个小问题 |
多谢提醒,我马上修改一下,我在args里面还是传字符串,然后加上判断筛选出真正的sort,会好一些 |
好的,感谢您的辛勤劳动 |
在命令行执行python文件
chat_paper.py
输入参数--sort arxiv.SortCriterion.LastUpdatedDate
会报错经过检查发现在
chat_paper.py
文件中解析--sort
参数的代码是可能是由于
parser.add_argument
方法中没有指定type
参数,因此python默认将arxiv.SortCriterion.LastUpdatedDate
作为str
类型解析,则与预期不符,由于arxiv.SortCriterion
是枚举类型,因此应该先指定type
参数并在命令行传入枚举类型的值
--sort lastUpdatedDate
才能正常运行请问这是一个bug么?
The text was updated successfully, but these errors were encountered: