This enables various things in order to support the CPython standard library.
MICROPY_PY_BUILTINS_NOTIMPLEMENTED:
Support NotImplemented for easy conversion of stdlib.
It doesn't do fallbacks though, only raises TypeError.
MICROPY_PY_COLLECTIONS_ORDEREDDICT:
collections.OrderedDict
MICROPY_PY_FUNCTION_ATTRS:
Support function.__name__ for use as key in the function attribute workaround.
MICROPY_PY_IO:
uio module: BytesIO, FileIO, StringIO, TextIOWrapper
Also add 'io' alias.
MICROPY_PY_REVERSE_SPECIAL_METHODS:
Support the __r*__ special methods.
MICROPY_PY_SYS_EXC_INFO:
sys.exc_info() used by unittest when collecting exceptions.
MICROPY_CPYTHON_COMPAT:
Some of the things it adds:
>>> object.__init__
<function>
>>> object.__new__
<function>
>>> object.__class__
<class 'type'>
>>> object().__class__
<class 'object'>
>>> object.__name__
'object'
>>> 'Hello'.encode()
b'Hello'
>>> b'Hello'.decode()
'Hello'
Named tuple field names from string:
namedtuple('Point', 'x y')
Add alias for uerrno so the user doesn't have to know about the
CircuitPython special names for the module.
Make os and time weak modules (aliases) making it possible to add
functionality to those modules written in python.
Example:
'import os' will now look in the path for an os module and if not found
it will import the builtin module. An os module written in python will
import the builtin module through its name prefixed with an underscore
(_os) following the C module naming practice in CPython.
Also right align the macro values to increase readability making it
easier to compare the values for samd21 and samd51. Even the longest
macro from py/mpconfig.h will fit with this alignment.
This is intended to be compatible with Python 3.7's time.monotonic_ns.
The "actual resolution" is 1ms due to this being the unit at which
common_hal_time_monotonic ticks.
Closes#519
Because of the very specific way nRF requires service registration
(characteristics can be added only to last added service), we would
have to write the Python code in a specific way. With this patch the
user has more freedom.