summaryrefslogtreecommitdiff
path: root/py/objstr.c
AgeCommit message (Collapse)Author
2014-07-31py: Add mp_obj_str_builder_end_with_len.Damien George
This allows to create str's with a smaller length than initially asked for.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-06-28py: Make unichar_charlen() accept/return machine_uint_t.Paul Sokolovsky
2014-06-28py: Small comments, name changes, use of machine_int_t.Damien George
2014-06-27objstrunicode: Refactor str_index_to_ptr() following objstr.Paul Sokolovsky
2014-06-27objstr: 64-bit issues.Paul Sokolovsky
2014-06-27objstr: find(), rfind(), index(): Make return value be unicode-aware.Paul Sokolovsky
2014-06-27objstrunicode: Re-add buffer protocol back for now, required for io.StringIO.Paul Sokolovsky
2014-06-27py: Make MICROPY_PY_BUILTINS_STR_UNICODE=1 buildable.Paul Sokolovsky
2014-06-27py: Prune unneeded code from objstrunicode, reuse code in objstr.Paul Sokolovsky
2014-06-14objstr: Refactor to work with char pointers instead of indexes.Paul Sokolovsky
In preparation for unicode support.
2014-06-14objstr: Be 8-bit clean even for repr().Paul Sokolovsky
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).
2014-06-08py: Make sure getattr() works with non-interned strings (by interning them).Paul Sokolovsky
2014-06-05Fix str.modulo when precision is specified.Dave Hylands
2014-06-05py: Raise TypeError when trying to format non-int with %x,%o,%X.Damien George
This behaviour follows Python 3.5 standard (in 3.4 it's a DeprecationWarning which we'd rather make a TypeError).
2014-06-05py: Small changes to objstr.c, including a bug fix.Damien George
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.
2014-06-05objstr: Implement "%(key)s" % {} formatting for strings and dicts.Paul Sokolovsky
Also, make sure that args to "*" format specifiers are bounds-checked properly and don't lead for segfaults in case of mismatch.
2014-06-05Replace assert(0) with a self-documenting TODO stringChris Angelico
2014-06-04Simplify detection of quote characters in mp_str_print_quoted.Chris Angelico
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.
2014-06-01py, str: Replace enum with actual function pointer.Damien George
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.
2014-06-01Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George
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.
2014-05-31objstr: str_uni_istype(): Spurious whitespace on empty lines.Paul Sokolovsky
2014-05-31objstr: str_uni_istype(): Codestyle.Paul Sokolovsky
2014-05-31add methods isspace(), isalpha(), isdigit(), isupper() and islower() to strKim Bauters
2014-05-30objstr: *strip(): If nothing is stripped, don't create dup string.Paul Sokolovsky
2014-05-30objstr: *strip(): Fix handling of one-char subject strings.Paul Sokolovsky
2014-05-25py: Slightly improve efficiency of mp_obj_new_str; rename str_new.Damien George
Reorder interning logic in mp_obj_new_str, to be more efficient. str_new is globally accessible, so should be prefixed with mp_obj_.
2014-05-25Change const byte* to const char* where sensible.Damien George
This removes need for some casts (at least, more than it adds need for new casts!).
2014-05-25objlist: Implement support for arbitrary (3-arg) slices.Paul Sokolovsky
2014-05-25py: Refactor slice helpers, preparing to support arbitrary slicing.Paul Sokolovsky
2014-05-25py: Handle case of slice start > stop in common sequence function.Paul Sokolovsky
2014-05-25objslice: Support arbitrary objects start, stop, and step.Paul Sokolovsky
Older int-only encoding is not expressive enough to support arbitrary slice assignment operations.
2014-05-24Rename configuration variables controling Python features.Damien George
Now of the form MICROPY_PY_*. See issue #35.
2014-05-24objstr: Implement .endswith().Paul Sokolovsky
2014-05-21py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.Damien George
See issue #608 for justification.
2014-05-15objstr: startswith(): Accept optional "start" arg.Paul Sokolovsky
2014-05-15py: Implement more complete bytes comparison handling.Paul Sokolovsky
2014-05-15objstringio: Implement io.BytesIO.Paul Sokolovsky
Done in generalized manner, allowing any stream class to be specified as working with bytes.
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.