Commit Graph

4 Commits

Author SHA1 Message Date
David Lechner 783b1a868f py/runtime: Allow multiple *args in a function call.
This is a partial implementation of PEP 448 to allow unpacking multiple
star args in a function or method call.

This is implemented by changing the emitted bytecodes so that both
positional args and star args are stored as positional args.  A bitmap is
added to indicate if an argument at a given position is a positional
argument or a star arg.

In the generated code, this new bitmap takes the place of the old star arg.
It is stored as a small int, so this means only the first N arguments can
be star args where N is the number of bits in a small int.

The runtime is modified to interpret this new bytecode format while still
trying to perform as few memory reallocations as possible.

Signed-off-by: David Lechner <david@pybricks.com>
2022-03-31 16:59:30 +11:00
Damien George 34f26ea862 tests: Allow tests to pass against CPython 3.5.
All breaking changes going from 3.4 to 3.5 are contained in
basics/python34.py.
2015-10-02 13:01:47 +01:00
Delio Brignoli e6978a4e26 py: Fix call args when a stararg is followed by keyword args. 2015-09-23 11:37:00 +01:00
Damien George 539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00