← index #10109Issue #4543
Off-topic · high · value 0.695
QUERY · ISSUE

Calling method with multiple named arguments does not raise SyntaxError

openby dlechopened 2022-11-27updated 2024-09-02
bugpy-core

It actually fixes a bug unrelated to double ** usage. Eg the following would previously pass without error:

def f(**x):
    print(x)

f(a=1, a=2)

Can you please add a test for that case as well?

Originally posted by @dpgeorge in https://github.com/micropython/micropython/issues/10095#issuecomment-1328186336

CANDIDATE · ISSUE

foo(*a,*b) is not supported

closedby smurfixopened 2019-02-23updated 2019-03-26

Python 3.x uses this construct in functools.

>>> a=(1,2)
>>> b=(3,4)
>>> print(*a,*b)
1 2 3 4

MicroPython:

>>> a=(1,2)
>>> b=(3,4)
>>> print(*a,*b)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SyntaxError: can't have multiple *x

Supporting this may not be particularly useful, but it should be documented.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied