aboutsummaryrefslogtreecommitdiff
path: root/py/objstr.c
AgeCommit message (Collapse)Author
2014-05-14objstr.c: Partial implementation of .rsplit().Paul Sokolovsky
sep=None is TODO.
2014-05-13py, unix: Add copyright for modules I worked closely on.Paul Sokolovsky
2014-05-11objstr: Slice indexing: support bytes properly.Paul Sokolovsky
2014-05-11objstr: Make .split() support bytes.Paul Sokolovsky
2014-05-11objstr: Make .join() support bytes.Paul Sokolovsky
2014-05-11py: Give up and make mp_obj_str_get_data() deal with bytes too.Paul Sokolovsky
This is not fully correct re: error handling, because we should check that that types are used consistently (only str's or only bytes), but magically makes lot of functions support bytes.
2014-05-11objstr: Make *strip() accept bytes.Paul Sokolovsky
2014-05-11objstr: Make .[r]partition() work with bytes.Paul Sokolovsky
2014-05-10py: Fix prefix on few sequence helpers, was incorrectly "mp_".Paul Sokolovsky
2014-05-10objstr: Implement .lower() and .upper().Paul Sokolovsky
2014-05-10py: Tidy up returning NULL which should be MP_OBJ_NOT_SUPPORTED.Damien George
2014-05-10bytes: Implement comparison and other binary operations.Paul Sokolovsky
Should support everything supported by strings.
2014-05-06py: bytes(), str(): Add NotImplementedError for kwargs.Paul Sokolovsky
Addresses #567.
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-05-02py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky
Specifically, nlr.h does.
2014-04-30py: Abstract no-return attribute for functions a bit.Paul Sokolovsky
2014-04-26objstr: Optimize .rstrip() by scanning string from end.Paul Sokolovsky
2014-04-26objstr: Implement .lstrip() & .rstrip().Paul Sokolovsky
Share code with .strip(). TODO: optimize .rstrip().
2014-04-19objstr: Init hash in mp_obj_str_builder_start() to 0.Paul Sokolovsky
2014-04-18py: Add typecode to buffer protocol.Damien George
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.
2014-04-17py: Add MP_OBJ_STOP_ITERATION and make good use of it.Damien George
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
2014-04-17py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.Damien George
mp_obj_t->subscr now does load/store/delete.
2014-04-15py: Add len(bytes).Damien George
2014-04-15py: Add builtin functions bin and oct, and some tests for them.Damien George
2014-04-14Make USE_COMPUTED_GOTO a config option in mpconfig.h.Damien George
Disabled by default. Enabled in unix port.
2014-04-14objstr: Allow to define statically allocated str objects.Paul Sokolovsky
Similar to tuples, lists, dicts. Statically allocated strings don't have hash computed.
2014-04-14qstr, objstr: Make sure that valid hash != 0, treat 0 as "not computed".Paul Sokolovsky
This feature was proposed with initial hashing RFC, and is prerequisite for seamless static str object definition.
2014-04-13py: Make bytes type hashable.Paul Sokolovsky
2014-04-13objstr: Add str.encode() and bytes.decode() methods.Paul Sokolovsky
These largely duplicate str() & bytes() constructors' functionality, but can be used to achieve Python2 compatibility.
2014-04-11py: Simplify and improve mp_get_index.Damien George
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).
2014-04-10objstr: Add TODO-optimize for using .join with arbitrary iterable.Paul Sokolovsky
2014-04-09Merge branch 'str-index' of github.com:xbe/micropython into xbe-str-indexDamien George
2014-04-09py: Add mp_obj_is_integer; make mp_get_index check for long int.Damien George
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.
2014-04-09py: str.join can now take arbitrary iterable as argument.Damien George
2014-04-08py: Implement str.[r]index() and add tests for them.xbe
2014-04-08py: Update comment in str.replace().xbe
2014-04-08bytes: Support buffer protocol.Paul Sokolovsky
2014-04-08Display \r and \t escape codes in string reprAndrew Scheller
2014-04-08py: Rename pfenv_print_int to pfenv_print_mp_int, and add back former.Damien George
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.
2014-04-07Add string formatting support for longlong and mpz.Dave Hylands
2014-04-07py: Fix str.replace for case when arg 0 or 1 is empty string.Damien George
2014-04-06py: str.split: handle non-default separator.Damien George
2014-04-05py: Change nlr_jump to nlr_raise, to aid in debugging.Damien George
This does not affect code size or performance when debugging turned off. To address issue #420.
2014-04-05Allow floating point arguments with %d,i,u,o,x,X formatsDave Hylands
2014-04-03Implements most of str.moduloDave Hylands
The alternate form for floating point doesn't work yet. The %(name)s form doesn't work yet.
2014-04-02Merge branch 'fix-format-int' of github.com:dhylands/micropython into ↵Damien George
dhylands-fix-format-int Conflicts: py/objstr.c
2014-04-02Fix str.format to work with {:f/g/e} and intsDave Hylands
Also fix objstr.c to compile when floats disabled.
2014-04-02py: Fix regress for printing of floats and #if.Damien George
Also change formating modifier in test script (it still passes with original format though).
2014-04-02py: Fix up so that it can compile without float.Damien George
2014-04-01Enhance str.format supportDave Hylands
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