| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2021-04-23 | py/objexcept: Support errno attribute on OSError exceptions. | Damien George | |
| This commit adds the errno attribute to exceptions, so code can retrieve errno codes from an OSError using exc.errno. The implementation here simply lets `errno` (and the existing `value`) attributes work on any exception instance (they both alias args[0]). This is for efficiency and to keep code size down. The pros and cons of this are: Pros: - more compatible with CPython, less difference to document and learn - OSError().errno will correctly return None, whereas the current way of doing it via OSError().args[0] will raise an IndexError - it reduces code size on most bare-metal ports (because they already have the errno qstr) - for Python code that uses exc.errno the generated bytecode is 2 bytes smaller and more efficient to execute (compared with exc.args[0]); so bytecode loaded to RAM saves 2 bytes RAM for each use of this attribute, and bytecode that is frozen saves 2 bytes flash/ROM for each use - it's easier/shorter to type, and saves 2 bytes of space in .py files that use it (for each use) Cons: - increases code size by 4-8 bytes on minimal ports that don't already have the `errno` qstr - all exceptions now have .errno and .value attributes (a cpydiff test is added to address this) See also #2407. Signed-off-by: Damien George <damien@micropython.org> | |||
| 2020-06-16 | tests/cpydiff: Add CPy diff test for assignment expression behaviour. | Damien George | |
| 2020-05-02 | tests/cpydiff: Add cpydiff test for __all__ used in imported package. | Jim Mussared | |
| 2020-03-30 | tests: Format all Python code with black, except tests in basics subdir. | David Lechner | |
| This adds the Python files in the tests/ directory to be formatted with ./tools/codeformat.py. The basics/ subdirectory is excluded for now so we aren't changing too much at once. In a few places `# fmt: off`/`# fmt: on` was used where the code had special formatting for readability or where the test was actually testing the specific formatting. | |||
| 2020-02-04 | tests: Move CPy diff test to real test now that subclass equality works. | Damien George | |
| Testing for equality of subclassed strings now works, thanks to commit 3aab54bf434e7f025a91ea05052f1bac439fad8c | |||
| 2020-02-04 | tests/cpydiff: Add os module environ differences. | David Lechner | |
| 2020-01-06 | tests/cpydiff: Add CPy diff-test for using dict.keys() as a set. | Damien George | |
| See issue #5493. | |||
| 2019-10-21 | tests/cpydiff: Fix typo in types_bytes_keywords.py doc comments. | clach04 | |
| 2018-09-26 | tests/cpydiff: Add case for difference in behaviour of bytes.format(). | Paul Sokolovsky | |
| 2018-05-08 | tests/cpydiff: Remove types_int_tobytesfloat now that it doesn't fail. | Damien George | |
| Commit e269cabe3ed8bed1b7181359febb686edbb748ae added a check that the first argument to the to_bytes() method is an integer, and now uPy follows CPython behaviour and raises a TypeError for this test. Note: CPython checks the argument types before checking the number of arguments, but uPy does it the other way around, so they give different exception messages for this test, but still the same type, a TypeError. | |||
| 2018-05-04 | tests/cpydiff: Remove working cases from types_float_rounding. | Damien George | |
| 2018-05-04 | tests/cpydiff: Remove types_str_decodeerror now that it succeeds. | Damien George | |
| Commit 68c28174d0e0ec3f6b1461aea3a0b6a1b84610bb implemented checking for valid utf-8 data. | |||
| 2018-05-04 | tests/cpydiff: Remove core_function_unpacking now that it succeeds. | Damien George | |
| Commit 1e70fda69fcb4991eb60ed43e610f664ea1319e6 fixes this difference. | |||
| 2018-03-15 | tests/cpydiff: Indent workaround code snippet so it formats correctly. | Damien George | |
| 2017-12-12 | tests/cpydiff: Update subclassing Exception case and give work-around. | Damien George | |
| 2017-12-03 | tests/cpydiff: Fix markup where "`" (xref) was used instead of "``" (code). | Paul Sokolovsky | |
| 2017-11-28 | tests/cpydiff: Add difference-test for second arg of builtin next(). | Damien George | |
| 2017-09-16 | tests/cpydiff: Add cases for locals() discrepancies. | Paul Sokolovsky | |
| MicroPython doesn't maintain local symbolic environment, so any feature depending on it won't work as expected. | |||
| 2017-07-09 | tests/cpydiff: Add case for str.ljust/rjust. | Paul Sokolovsky | |
| 2017-07-09 | tests/cpydiff/: Improve wording, add more workarounds. | Paul Sokolovsky | |
| 2017-07-09 | tests/cpydiff/core_class_supermultiple: Same cause as core_class_mro. | Paul Sokolovsky | |
| 2017-07-09 | tests/cpydiff/core_arguments: Move under Functions subsection. | Paul Sokolovsky | |
| This is the last "orphan" case. | |||
| 2017-07-09 | tests/cpydiff/core_class_mro: Move under Classes, add workaround. | Paul Sokolovsky | |
| 2017-07-05 | tests/cpydiff/modules_deque: Elaborate workaround. | Paul Sokolovsky | |
| 2017-05-06 | tests: Move super-as-local test from cpydiff to basic tests. | Damien George | |
| It's now possible to use the name "super" as a local variable. | |||
| 2017-05-04 | tests/cpydiff/core_function_unpacking: Fill in workaround. | Paul Sokolovsky | |
| 2017-05-03 | tests/cpydiff/core_import_split_ns_pkgs: Test for split namespace packages. | Paul Sokolovsky | |
| 2017-05-03 | tests/cpydiff/core_import_path: Test showing difference in package.__path__. | Paul Sokolovsky | |
| 2017-05-02 | tests/cpydiff/core_import_prereg: Fill in cause and workaround. | Paul Sokolovsky | |
| 2017-05-02 | tests/cpydiff/core_function_userattr: Clarify, fill in cause and workaround. | Paul Sokolovsky | |
| 2017-05-02 | tests/cpydiff/core_arguments: Fill in cause/workaround. | Paul Sokolovsky | |
| 2017-02-20 | tests/cpydiff: Add a test for storing iterable to a list slice. | Damien George | |
| 2017-02-20 | tests/cpydiff: Add initial set of tests for uPy-CPython differences. | Rami Ali | |
| These tests are intended to fail, as they provide a programatic record of differences between uPy and CPython. They also contain a special comment at the start of the file which has meta-data describing the difference, including known causes and known workarounds. | |||
