On Thu, Mar 9, 2017 at 9:39 AM, Brice PARENT <cont...@brice.xyz> wrote:
> But a possible workaround, is if we used the first positional argument of
> dict() as the default value. As right now it doesn't accept positional
> arguments (or at least if they are not iterable, which complicates a bit the
> thing), we could allow a syntax like :
> d = dict([default, ][*args, ]**kwargs)
> where default is a callable, *args made of iterables, and kwargs any kwargs.

There'd still be a pile of special cases. Granted, there aren't going
to be very many objects that are both callable and iterable, but there
certainly _can be_, and if one were passed as the first argument, it
would be ambiguous.

Safer to keep this out of the signature of dict itself.

ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to