On 23 February 2012 22:04, Chris Angelico <ros...@gmail.com> wrote: > On Fri, Feb 24, 2012 at 8:59 AM, Arnaud Delobelle <arno...@gmail.com> wrote: >> def sum(iterable, start=_sentinel, _sentinel=_sentinel): > > Is this a reason for Python to introduce a new syntax, such as: > > def foo(blah, optional=del): > if optional is del: print("No argument was provided") > > Basically, 'del' is treated like a unique non-providable object, only > possible in an argument list and only if the argument was omitted. No > more proliferation of individual sentinels... what do you think?
The problem with these proposals is to avoid the leakage of 'del'. Here you could do: def get_del(x=del): return x And then you're in trouble again. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list