| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
There were several different spellings of MicroPython present in comments,
when there should be only one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows to iterate over the following without allocating on the heap:
- tuple
- list
- string, bytes
- bytearray, array
- dict (not dict.keys, dict.values, dict.items)
- set, frozenset
Allows to call the following without heap memory:
- all, any, min, max, sum
TODO: still need to allocate stack memory in bytecode for iter_buf.
|
|
|
|
|
|
| |
Its addition was due to an early exploration on how to add CPython-like
stream interface. It's clear that it's not needed and just takes up
bytes in all ports.
|
| |
|
|
|
|
|
|
|
| |
This includes file and socket objects, backed by Unix file descriptor.
This improves compatibility with stmhal's uselect (and convenience of
use), though not completely: return value from poll.poll() is still
raw file descriptor.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
As per PEP-475.
|
|
|
|
|
| |
It's now used for more than just stream protocol (e.g. pin protocol), so
don't use false names.
|
|
|
|
|
| |
And with "buffering" arg introduced, it's non possible to make it
non-kwonly.
|
|
|
|
|
| |
It's ignored (unbuffered, raw I/O is used), but least makes it compatible
with CPython.
|
|
|
|
| |
That's not true e.g. on Linux.
|
|
|
|
|
|
|
|
| |
The first argument to the type.make_new method is naturally a uPy type,
and all uses of this argument cast it directly to a pointer to a type
structure. So it makes sense to just have it a pointer to a type from
the very beginning (and a const pointer at that). This patch makes
such a change, and removes all unnecessary casting to/from mp_obj_t.
|
|
|
|
|
| |
With this patch the n_args parameter is changed type from mp_uint_t to
size_t.
|
|
|
|
|
|
|
| |
This patch changes the type signature of .make_new and .call object method
slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more
efficient when mp_uint_t is larger than a machine word. Doesn't affect
ports when size_t and mp_uint_t have the same size.
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows the mp_obj_t type to be configured to something other than a
pointer-sized primitive type.
This patch also includes additional changes to allow the code to compile
when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
mp_uint_t, and various casts.
|
| |
|
| |
|
|
|
|
| |
To comply with Python semantics.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous to this patch the printing mechanism was a bit of a tangled
mess. This patch attempts to consolidate printing into one interface.
All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf. All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.
Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform. The former is only used when MICROPY_PY_IO is defined.
With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...). Code size is also reduced by around 200 bytes on
Thumb2 archs.
|
|
|
|
| |
See issue #699.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also, implement for unix port.
|
|
|
|
|
|
|
| |
This makes open() and _io.FileIO() more CPython compliant.
The mode kwarg is fully iplemented.
The encoding kwarg is allowed but not implemented; mainly to allow
the tests to specify encoding for CPython, see #874
|
|
|
|
|
|
| |
Also, usocket.readinto(). Known issue is that .readinto() should be available
only for binary files, but micropython uses single method table for both
binary and text files.
|
|
|
|
| |
Addressing issue #50, still some way to go yet.
|
|
|
|
| |
Addresses issue #724.
|
| |
|
| |
|
| |
|
|
|
|
| |
This method apparently should be part of stream interface.
|
|
|
|
| |
See discussion in issue #50.
|
|
|
|
| |
Now of the form MICROPY_PY_*. See issue #35.
|
|
|
|
|
|
|
| |
io.FileIO is binary I/O, ans actually optional. Default file type is
io.TextIOWrapper, which provides str results. CPython3 explicitly describes
io.TextIOWrapper as buffered I/O, but we don't have buffering support yet
anyway.
|
|
|
|
|
|
|
| |
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/.
|
| |
|
| |
|
|
|
|
|
| |
In CPython any operations on a file that has been closed already reaises
a ValueError with message "I/O operation on closed file"
|
|
|
|
| |
Specifically, nlr.h does.
|
| |
|
|
|
|
| |
Well, Python3 also defines an attribute for that, but that's bloat.
|
|
|
|
| |
TODO: Never "optimize" includes any more!
|
| |
|