| Commit message (Collapse) | Author | Age |
|
|
|
| |
Addresses issue #934.
|
|
|
|
|
|
|
| |
This should be pretty compliant with CPython, except perhaps for some
corner cases to do with globals/locals context.
Addresses issue #879.
|
| |
|
| |
|
|
|
|
|
| |
It's purpose is for internal errors that are not catastrophic (ie not as
bad as RuntimeError). Since we don't use it, we don't need it.
|
| |
|
|\
| |
| | |
Module "uzlib" - based on similarly named library
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
With this patch a port can enable module weak link support and provide
a dict of qstr->module mapping. This mapping is looked up only if an
import fails to find the requested module in the filesystem.
This allows to have the builtin module named, eg, usocket, and provide
a weak link of "socket" to the same module, but this weak link can be
overridden if a file by the name "socket.py" is found in the import
path.
|
|
|
|
| |
https://github.com/pfalcon/re1.5
|
|
|
|
|
|
|
|
|
|
|
| |
In CPython IOError (and EnvironmentError) is deprecated and aliased to
OSError. All modules that used to raise IOError now raise OSError (or a
derived exception).
In Micro Python we never used IOError (except 1 place, incorrectly) and
so don't need to keep it.
See http://legacy.python.org/dev/peps/pep-3151/ for background.
|
| |
|
|
|
|
|
| |
Also add start of ujson module with dumps implemented. Enabled in unix
and stmhal ports. Test passes on both.
|
| |
|
| |
|
|
|
|
| |
Also fix unix port so that SystemExit with no arg exits with value 0.
|
| |
|
|
|
|
|
|
|
|
| |
reversed function now implemented, and works for tuple, list, str, bytes
and user objects with __len__ and __getitem__.
Renamed mp_builtin_len to mp_obj_len to make it publically available (eg
for reversed).
|
|
|
|
|
| |
But much smaller and memory-efficient. Uses Python builtin data structures
(dict, tuple, int) to describe structure layout.
|
|
|
|
|
| |
array.array and bytearray share big deal of code, so to get real savings,
both need to be disabled.
|
|
|
|
|
|
| |
It defines types used by all other headers.
Fixes #691.
|
|
|
|
|
| |
One thing is wanting to do 1 / 2 and get something else but 0, and quite
another - doing rocket science ;-).
|
| |
|
|
|
|
|
|
|
|
| |
Functionality we provide in builtin io module is fairly minimal. Some
code, including CPython stdlib, depends on more functionality. So, there's
a choice to either implement it in C, or move it _io, and let implement other
functionality in Python. 2nd choice is pursued. This setup matches CPython
too (_io is builtin, io is Python-level).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This renames:
MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET
MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY
MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE
MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT
See issue #35 for discussion.
|
|
|
|
| |
Now of the form MICROPY_PY_*. See issue #35.
|
|
|
|
|
|
|
|
|
|
| |
MP_ALLOC_* -> MICROPY_ALLOC_*
MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX
MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL
MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX
MICROPY_EXTRA_* -> MICROPY_PORT_*
See issue #35.
|
| |
|
|
|
|
| |
Tired of patching CPython stdlib for it.
|
| |
|
|
|
|
|
|
|
| |
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
|
| |
|
| |
|
|
|
|
| |
Addresses issue #487.
|
|
|
|
| |
Not all functions implemented. Not enabled on pyboard.
|
| |
|
|
|
|
| |
A one-liner, added especially for @pfalcon :)
|
|
|
|
| |
Enabled by MICROPY_ENABLE_PROPERTY.
|
| |
|
|\
| |
| | |
Convert sys module to static allocation
|
| | |
|
|/
|
|
|
| |
We're not going to implement all the plethora of types in there in C.
Funnily, CPython implements defaultdict in C, and namedtuple in Python.
|
|
|
|
|
|
|
|
|
| |
Only calcsize() and unpack() functions provided so far, for little-endian
byte order. Format strings don't support repition spec (like "2b3i").
Unfortunately, dealing with all the various binary type sizes and alignments
will lead to quite a bloated "binary" helper functions - if optimizing for
speed. Need to think if using dynamic parametrized algos makes more sense.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Finishes addressing issue #424.
In the end this was a very neat refactor that now makes things a lot
more consistent across the py code base. It allowed some
simplifications in certain places, now that everything is a dict object.
Also converted builtins tables to dictionaries. This will be useful
when we need to turn builtins into a proper module.
|
|
|
|
| |
That's how CPython has it, in particular, "import __main__" should work.
|