On Thu, Feb 14, 2008 at 6:04 PM, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > Now can you come up with a syntax for positional-only
> > arguments? So far everybody has failed at that, and there are some use
> > cases where it's useful too.
>
> def foo(*(a, b,c)):
> ...
>
> i.e. catch them in a * arg which is unpacked in-place.
I thought the ability to do that was being removed in py3?
throwing some ideas around, for all examples arg1 and arg2 would be
positional only
def test(<arg1, arg2>, arg3, *arg4):
...
It's ok, since it clearly groups the positional only args, but the
parser might not be able to handle this.
def test(|arg1, |arg2, arg3, *, arg4):
...
Simple, but inelegant. In just looking at the code it seems wrong.
def test(arg1, arg2, |, arg3, *, arg4):
...
I like this idea better, use the pipe as a separator for positional
only, and normal arguments.
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com