Antoon Pardon <[EMAIL PROTECTED]> wrote:
>  One possible way to do what I think you want is to code as follows:
> 
>  class Default (object):
>    pass

I'd have written

Default = object()

>  def f(var=Default):
>    if var is Default:
>      var = 1
>    return var * 2
> 

But yes, defining a sentinel like this is a good idea.

-- 
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to