On Wed, 2009-01-14 at 16:58 +1000, James Mills wrote:
[...]
> Still I would avoid using this idiom altogether
> and jsut stick with default values. For Example:
> 
> FOO = 1
> 
> def f(x=FOO):
>    ...
> 
> 
> Use this instead:
> 
> def f(x=1):
>    ...

That only works well when "1" is only used once, and as an argument to a
function. Once you find yourself outside of that special case then
anytime you want to change "1" to "2" then you're going to regret having
made that decision.


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to