Issue 1200 in openbookproject: parrot() # 缺少必要的参数 parrot(voltage=5.0, 'dead') # 在关键字后面跟着非关键字参数 parrot(110, voltage=220) # 同一参数给了多个值 parrot(actor='John Cleese') # 未知关键字 在函式调用时, 关键字参数必须跟在位置参数之后. 所有的关键字参数都必须与函式接受的形式参数匹配 (例如, actor 在函式 parrot 看来就是非法参数), 但他们的顺序是无关紧要的

2 views
Skip to first unread message

openboo...@googlecode.com

unread,
Mar 5, 2014, 9:38:49 AM3/5/14
to openboo...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1200 by LGYR...@gmail.com: parrot() # 缺少必
要的参数 parrot(voltage=5.0, 'dead') # 在关键字后面跟着非关键字参数
parrot(110, voltage=220) # 同一参数给了多个值 parrot(actor='John
Cleese') # 未知关键字 在函式调用时, 关键字参数必须跟在位置参数之后. 所有的
关键字参数都必须与函式接受的形式参数匹配 (例如, actor 在函式 parrot 看来就是
非法参数), 但他们的顺序是无关紧要的
http://code.google.com/p/openbookproject/issues/detail?id=1200

现在内容:
这条规则也适用于非可选参数 (例如, parrot(voltage=1000) 也是非法的).
修订建议:
这条规则也适用于非可选参数 (例如, parrot(voltage=1000) 也是有效的).
理由:
This also includes non-optional arguments (e.g. parrot(voltage=1000) is
valid too).这是原文,请仔细看清,是valid,而不是invalid.而且本人且测程序,使
用括号中的方法调用是可以的。

[注意]:尽量一个意见建立对应一个Issue!
* 同时选择恰当的标签来标记修订建议的分类,比如说:"[Lo
vPy]"指 可爱的Python 图书相关
* 一般要求有:
Type(类型);Priority(优先);Component(组件);Milestone(里程碑进度)




--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages