Repository navigation
Conversation
Based on work done by Jim Mussared.
|
To make progress towards MicroPython supporting Python 3.5, adding the matmul operator is important because it's a really "low level" part of the language, being a new token and modifications to the grammar. I don't think it's sensible to make it configurable because 1) it would make the grammar and lexer complicated/messy; 2) no other operators are configurable; 3) it's not a feature that can be "dynamically plugged in" via an import. And matmul can be useful as a general purpose user-defined operator, it doesn't have to be just for numpy use, as argued in #1329 (comment) |
|
Note: coverage decrease here is because now there are less total lines in the code base, with the same number of lines covered by tests, so percentage coverage dropped. |
Makes sense. Would be like having |
Right. Floats are configurable, but you can still use the |
Fix bytes() and bytearray() input validation
Based on #4740, add support for
__matmul__, with further optimisations to reduce code size.The first 3 commits here apply some space-saving optimisations to the lexer/parser/compiler and achieve a change in code size of:
Then adding support for matmul changes code size by:
So that the total change in code size for the whole PR here is: