Dj Gilcrease schrieb:
> On Fri, Feb 15, 2008 at 8:46 AM, Joel Bender <[EMAIL PROTECTED]> wrote:
>> How about a BNFish notation? Use brackets around optional parameters.
>>
>> def test([arg1, [arg2,]] arg3):
>> ...
>
> If I understand right, positional only arguments would not be optional
> in any way shape or form, thats what default arguments are for.
> Positional only args would be arguments that you cannot specify by
> keyword, so having a positional only arg that has a default value,
> thus making it optional just seems broken to me.
Being positional-only and having a default value does not conflict.
There's nothing at all broken with
def foo(!x, !y='bar'):
pass
where !x and !y would be positional-only arguments. You can't of course
have something like
def foo(!x, !y='bar', z):
pass
but you can't have that today either.
Georg
--
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.
_______________________________________________
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