summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/python34.py
Commit message (Collapse)AuthorAge
* py/runtime: Allow multiple *args in a function call.David Lechner2022-03-31
| | | | | | | | | | | | | | | | | | | 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>
* py/runtime: Allow multiple **args in a function call.David Lechner2022-03-31
| | | | | | | | | | | | | | This is a partial implementation of PEP 448 to allow multiple ** unpackings when calling a function or method. The compiler is modified to encode the argument as a None: obj key-value pair (similar to how regular keyword arguments are encoded as str: obj pairs). The extra object that was pushed on the stack to hold a single ** unpacking object is no longer used and is removed. The runtime is modified to decode this new format. Signed-off-by: David Lechner <david@pybricks.com>
* all: Rename "sys" module to "usys".stijn2020-09-04
| | | | | | | | | This is consistent with the other 'micro' modules and allows implementing additional features in Python via e.g. micropython-lib's sys. Note this is a breaking change (not backwards compatible) for ports which do not enable weak links, as "import sys" must now be replaced with "import usys".
* tests: Modify tests that print repr of an exception with 1 arg.Damien George2018-08-17
| | | | | | | | | | In Python 3.7 the behaviour of repr() of an exception with one argument changed: it no longer prints a trailing comma in the argument list. See https://bugs.python.org/issue30399 This patch modifies tests that rely on this behaviour to not rely on it. And the python34.py test is updated to include a test for this behaviour with a .exp file.
* tests: Automatically skip tests that require eval, exec or frozenset.Damien George2018-02-14
|
* py/compile: Raise SyntaxError if positional args are given after */**.Damien George2017-06-14
| | | | | | | | In CPython 3.4 this raises a SyntaxError. In CPython 3.5+ having a positional after * is allowed but uPy has the wrong semantics and passes the arguments in the incorrect order. To prevent incorrect use of a function going unnoticed it is important to raise the SyntaxError in uPy, until the behaviour is fixed to follow CPython 3.5+.
* tests: Update test suite to be compatible with CPython 3.6.Damien George2017-01-09
| | | | | | | | CPython 3.6 has a few changes that, when run on uPy's test suite, give a different output to CPython 3.5. uPy currently officially supports the 3.4 language definition, but it's useful to be able to run the test suite with 3.4/3.5/3.6 versions of CPython. This patch makes such changes to support 3.6.
* tests: Add test for evaluation order of dictionary key/value pairs.Damien George2015-10-08
| | | | | In Python 3.4 the value is evaluated before the key. In Python 3.5 it's key then value.
* tests: Allow tests to pass against CPython 3.5.Damien George2015-10-02
All breaking changes going from 3.4 to 3.5 are contained in basics/python34.py.