Christian Heimes added the comment:
I'm fine with your patch. Can you commit it please?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
___
Python-bugs-list mailing list
Amaury Forgeot d'Arc added the comment:
Committed revision 59443.
--
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
___
Python-bugs-list
Changes by Alexandre Vassalotti:
--
versions: +Python 3.0
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexandre Vassalotti:
I found that the parser fails to handle correctly the (incorrect) case
where the single-star (*), used for delimiting keyword-only arguments,
is immediately followed by a **keywords parameter:
def f(*, **kw):
... pass
...
python: Python/ast.c:652:
Christian Heimes added the comment:
Fixed in r59432
I've altered the assert(). It now checks if either kwonlyargs and
kwdefault or both not NULL or the next node is a DOUBLESTAR.
--
nosy: +tiran
__
Tracker [EMAIL PROTECTED]
Changes by Christian Heimes:
--
resolution: - fixed
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
___
Python-bugs-list mailing list
Amaury Forgeot d'Arc added the comment:
Err... I think it should raise a SyntaxError in this case.
See my attached patch.
--
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file8894/kwonly.patch
__
Tracker [EMAIL PROTECTED]
Changes by Amaury Forgeot d'Arc:
--
status: closed - open
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
___
Python-bugs-list mailing list
Unsubscribe:
Christian Heimes added the comment:
Why do you want to forbid
def f(*, **kw)
? It's useful and it also works in release builds of Python 3.0a2. It
only breaks in debug builds because the assert() gets triggered.
__
Tracker [EMAIL PROTECTED]
Alexandre Vassalotti added the comment:
Amaury is right. def f(*, **kw): pass should raise a SyntaxError. The
keyword-only delimiter is useless since the **kw parameter already only
accepts keywords.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
Amaury Forgeot d'Arc added the comment:
Why do you want to forbid
def f(*, **kw)
Well, TOOWTDI and the like...
and the first time I saw it, it seemed that any number of parameters is
allowed!
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
Christian Heimes added the comment:
Ah, you and Amaury are right! But I don't like Amaury's error message:
SyntaxError: no name for vararg
It doesn't explain what's wrong. How about
SyntaxError: keyword only arguments require at least one keyword
__
Christian Heimes added the comment:
Kirk McDonald has an even better error message for us:
SyntaxError: Cannot specify keyword only arguments without named arguments
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
Christian Heimes added the comment:
Here is another error message from Thomas Wouters 'named arguments must
follow bare *'
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1573
__
Amaury Forgeot d'Arc added the comment:
Right.
We should also replace the other occurence of no name for vararg.
Here is another patch, against the current revision (59434).
Added file: http://bugs.python.org/file8895/kwonly2.patch
__
Tracker [EMAIL PROTECTED]
15 matches
Mail list logo