Fix mutable default arguments (config.foo values).
config.blah should not be used as a default argument as the values can
change during execution, but default arguments are only evaluated at
function definition time. The correct idiom is to use a sentinel value
such as None and then check for it, and read out the config value in the
function body.
正在显示
请
注册
或者
登录
后发表评论