Commit message (Collapse) | Author | Age | |
---|---|---|---|
* | py: Allow bytes object as argument to some str methods. | Damien George | 2014-11-05 |
| | | | | | | This turns failing assertions to type exceptions for things like b"123".find(...). We still don't support operations like this on bytes objects (unlike CPython), but at least it no longer crashes. | ||
* | py: Allow +, in, and compare ops between bytes and bytearray/array. | Damien George | 2014-11-05 |
| | | | | | | Eg b"123" + bytearray(2) now works. This patch actually decreases code size while adding functionality: 32-bit unix down by 128 bytes, stmhal down by 84 bytes. | ||
* | objstr: Allow to convert any buffer proto object to str. | Paul Sokolovsky | 2014-10-31 |
| | | | | | Original motivation is to support converting bytearrays, but easier to just support buffer protocol at all. | ||
* | py: mp_obj_str_get_str(): Work with bytes too. | Paul Sokolovsky | 2014-10-31 |
| | | | | | | | It should be fair to say that almost in all cases where some API call expects string, it should be also possible to pass byte string. For example, it should be open/delete/rename file with name as bytestring. Note that similar change was done quite a long ago to mp_obj_str_get_data(). | ||
* | py: Use MP_OBJ_NULL instead of NULL in a few places. | Damien George | 2014-10-23 |
| | |||
* | py: Make mp_const_empty_bytes globally available. | Damien George | 2014-10-21 |
| | |||
* | py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places. | Damien George | 2014-10-03 |
| | | | | This should pretty much resolve issue #50. | ||
* | py: Simplify JSON str printing (while still conforming to JSON spec). | Damien George | 2014-09-25 |
| | | | | | The JSON specs are relatively flexible and allow us to use one function to print strings, be they ascii, bytes or utf-8 encoded. | ||
* | py: Add native json printing using existing print framework. | Damien George | 2014-09-17 |
| | | | | | Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both. | ||
* | py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, working towards resolving issue #50. | ||
* | py: Remove use of int type in obj.h. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, working towards resolving issue #50. | ||
* | py: Change all uint to mp_uint_t in obj.h. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, working towards resolving issue #50. | ||
* | py: Make tuple and list use mp_int_t/mp_uint_t. | Damien George | 2014-08-30 |
| | | | | Part of code cleanup, to resolve issue #50. | ||
* | Change some parts of the core API to use mp_uint_t instead of uint/int. | Damien George | 2014-08-30 |
| | | | | Addressing issue #50, still some way to go yet. | ||
* | py: Use memmove instead of memcpy when appropriate. | Damien George | 2014-08-29 |
| | | | | | Found this bug by running unix/ tests with DEBUG=1 enabled when compiling. | ||
* | py: Improve efficiency of MP_OBJ_IS_STR_OR_BYTES. | Damien George | 2014-08-27 |
| | | | | | Saves ROM (16 on stmhal, 240 on 64-bit unix) and should be quicker since there is 1 less branch. | ||
* | Make int(b'123') work properly. | Dave Hylands | 2014-08-26 |
| | |||
* | py: Fix mult by negative number of tuple, list, str, bytes. | Damien George | 2014-08-13 |
| | | | | | | | Multiplication of a tuple, list, str or bytes now yields an empty sequence (instead of crashing). Addresses issue #799 Also added ability to mult bytes on LHS by integer. | ||
* | py, objstr: Optimise bytes subscr when unicode is enabled. | Damien George | 2014-08-11 |
| | | | | Saves code bytes and makes it faster, so why not? | ||
* | objstr: Make sure that bytes are indexed as bytes, not as unicode. | Paul Sokolovsky | 2014-08-11 |
| | | | | Fixes #795. | ||
* | objstr: split(): check arg type consistency (str vs bytes). | Paul Sokolovsky | 2014-08-10 |
| | | | | Similar to other methods and following CPython3 strictness. | ||
* | py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself. | Damien George | 2014-07-31 |
| | | | | Addresses issue #724. | ||
* | py: Add mp_obj_str_builder_end_with_len. | Damien George | 2014-07-31 |
| | | | | | This allows to create str's with a smaller length than initially asked for. | ||
* | Rename machine_(u)int_t to mp_(u)int_t. | Damien George | 2014-07-03 |
| | | | | See discussion in issue #50. | ||
* | py: Make unichar_charlen() accept/return machine_uint_t. | Paul Sokolovsky | 2014-06-28 |
| | |||
* | py: Small comments, name changes, use of machine_int_t. | Damien George | 2014-06-28 |
| | |||
* | objstrunicode: Refactor str_index_to_ptr() following objstr. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstr: 64-bit issues. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstr: find(), rfind(), index(): Make return value be unicode-aware. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstrunicode: Re-add buffer protocol back for now, required for io.StringIO. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | py: Make MICROPY_PY_BUILTINS_STR_UNICODE=1 buildable. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | py: Prune unneeded code from objstrunicode, reuse code in objstr. | Paul Sokolovsky | 2014-06-27 |
| | |||
* | objstr: Refactor to work with char pointers instead of indexes. | Paul Sokolovsky | 2014-06-14 |
| | | | | In preparation for unicode support. | ||
* | objstr: Be 8-bit clean even for repr(). | Paul Sokolovsky | 2014-06-14 |
| | | | | | | | | | This will allow roughly the same behavior as Python3 for non-ASCII strings, for example, print("<phrase in non-Latin script>".split()) will print list of words, not weird hex dump (like Python2 behaves). (Of course, that it will print list of words, if there're "words" in that phrase at all, separated by ASCII-compatible whitespace; that surely won't apply to every human language in existence). | ||
* | py: Make sure getattr() works with non-interned strings (by interning them). | Paul Sokolovsky | 2014-06-08 |
| | |||
* | Fix str.modulo when precision is specified. | Dave Hylands | 2014-06-05 |
| | |||
* | py: Raise TypeError when trying to format non-int with %x,%o,%X. | Damien George | 2014-06-05 |
| | | | | | This behaviour follows Python 3.5 standard (in 3.4 it's a DeprecationWarning which we'd rather make a TypeError). | ||
* | py: Small changes to objstr.c, including a bug fix. | Damien George | 2014-06-05 |
| | | | | | | | | | | | | | | Some small fixed: - Combine 'x' and 'X' cases in str format code. - Remove trailing spaces from some lines. - Make exception messages consistently begin with lower case (then needed to change those in objarray and objtuple so the same constant string data could be used). - Fix bug with exception message having %c instead of %%c. | ||
* | objstr: Implement "%(key)s" % {} formatting for strings and dicts. | Paul Sokolovsky | 2014-06-05 |
| | | | | | Also, make sure that args to "*" format specifiers are bounds-checked properly and don't lead for segfaults in case of mismatch. | ||
* | Replace assert(0) with a self-documenting TODO string | Chris Angelico | 2014-06-05 |
| | |||
* | Simplify detection of quote characters in mp_str_print_quoted. | Chris Angelico | 2014-06-04 |
| | | | | | Once a double quote has been found, the subsequent discovery of a single quote won't change behaviour at all, so don't bother looking for one. | ||
* | py, str: Replace enum with actual function pointer. | Damien George | 2014-06-01 |
| | | | | | | This way, it's slightly more efficient, uses less ROM (60 bytes less for stmhal), and doesn't require to raise exception if bad operation given. | ||
* | Rename bultins config variables to MICROPY_PY_BUILTINS_*. | Damien George | 2014-06-01 |
| | | | | | | | | | | 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. | ||
* | objstr: str_uni_istype(): Spurious whitespace on empty lines. | Paul Sokolovsky | 2014-05-31 |
| | |||
* | objstr: str_uni_istype(): Codestyle. | Paul Sokolovsky | 2014-05-31 |
| | |||
* | add methods isspace(), isalpha(), isdigit(), isupper() and islower() to str | Kim Bauters | 2014-05-31 |
| | |||
* | objstr: *strip(): If nothing is stripped, don't create dup string. | Paul Sokolovsky | 2014-05-30 |
| | |||
* | objstr: *strip(): Fix handling of one-char subject strings. | Paul Sokolovsky | 2014-05-30 |
| | |||
* | py: Slightly improve efficiency of mp_obj_new_str; rename str_new. | Damien George | 2014-05-25 |
| | | | | | | Reorder interning logic in mp_obj_new_str, to be more efficient. str_new is globally accessible, so should be prefixed with mp_obj_. | ||
* | Change const byte* to const char* where sensible. | Damien George | 2014-05-25 |
| | | | | | This removes need for some casts (at least, more than it adds need for new casts!). |