| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
| |
Share code with .strip(). TODO: optimize .rstrip().
|
| |
|
|
|
|
|
|
|
| |
When querying an object that supports the buffer protocol, that object
must now return a typecode (as per binary.[ch]). This does not have to
be honoured by the caller, but can be useful for determining element
size.
|
|
|
|
|
| |
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL.
This helps a lot in debugging and understanding of function API.
|
|
|
|
| |
mp_obj_t->subscr now does load/store/delete.
|
| |
|
| |
|
|
|
|
| |
Disabled by default. Enabled in unix port.
|
|
|
|
|
| |
Similar to tuples, lists, dicts. Statically allocated strings don't have hash
computed.
|
|
|
|
|
| |
This feature was proposed with initial hashing RFC, and is prerequisite for
seamless static str object definition.
|
| |
|
|
|
|
|
| |
These largely duplicate str() & bytes() constructors' functionality,
but can be used to achieve Python2 compatibility.
|
|
|
|
|
|
|
| |
It has (again) a fast path for ints, and a simplified "slow" path for
everything else.
Also simplify the way str indexing is done (now matches tuple and list).
|
| |
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
mp_obj_is_integer should be used to check if an object is of integral
type. It returns true for bool, small int and long int.
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
stmhal relies on pfenv_* to implement its printf. Thus, it needs a
pfenv_print_int which prints a proper 32-bit integer. With latest
change to pfenv, this function became one that took mp_obj_t, and
extracted the integer value from that object.
To fix temporarily, pfenv_print_int has been renamed to
pfenv_print_mp_int (to indicate it takes a mp_obj_t for the int), and
pfenv_print_int has been added (which takes a normal C int). Currently,
pfenv_print_int proxies to pfenv_print_mp_int, but this means it looses
the MSB. Need to find a way to fix this, but the only way I can think
of will duplicate lots of code.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This does not affect code size or performance when debugging turned off.
To address issue #420.
|
| |
|
|
|
|
|
| |
The alternate form for floating point doesn't work yet.
The %(name)s form doesn't work yet.
|
|\
| |
| |
| |
| |
| |
| | |
dhylands-fix-format-int
Conflicts:
py/objstr.c
|
| |
| |
| |
| | |
Also fix objstr.c to compile when floats disabled.
|
|/
|
|
|
| |
Also change formating modifier in test script (it still passes with
original format though).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for almost everything (the comma isn't currently
supported).
The "unspecified" type with floats also doesn't behave exactly like
python.
Tested under unix with float and double
Spot tested on stmhal
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Pretty much everyone needs to include map.h, since it's such an integral
part of the Micro Python object implementation. Thus, the definitions
are now in obj.h instead. map.h is removed.
|
|
|
|
|
|
|
| |
Mostly just a global search and replace. Except rt_is_true which
becomes mp_obj_is_true.
Still would like to tidy up some of the names, but this will do for now.
|
| |
|
|
|
|
| |
Addresses issue #388.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally, .methods was used for methods in a ROM class, and
locals_dict for methods in a user-created class. That distinction is
unnecessary, and we can use locals_dict for ROM classes now that we have
ROMable maps.
This removes an entry in the bloated mp_obj_type_t struct, saving a word
for each ROM object and each RAM object. ROM objects that have a
methods table (now a locals_dict) need an extra word in total (removed
the methods pointer (1 word), no longer need the sentinel (2 words), but
now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a
word because they never used the methods entry.
Overall the ROM usage is down by a few hundred bytes, and RAM usage is
down 1 word per user-defined type/class.
There is less code (no need to check 2 tables), and now consistent with
the way ROM modules have their tables initialised.
Efficiency is very close to equivaluent.
|
|
|
|
| |
Addresses issue #377.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This is pre-requisite for having efficient implementation of str<->bytes
conversion, and having that efficient is required with unfortunare
str vs bytes dichotomy in Python3.
|