summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib/stringdefs.h
Commit message (Collapse)AuthorAgeFilesLines
* Issue #7622: Improve the split(), rsplit(), splitlines() and replace()Antoine Pitrou2010-01-131-0/+5
| | | | | methods of bytes, bytearray and unicode objects by using a common implementation based on stringlib's fast search. Patch by Florent Xicluna.
* Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,Antoine Pitrou2010-01-021-1/+0
| | | | `rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
* Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to ↵Eric Smith2009-04-271-11/+2
| | | | py3k. Should fix Windows buildbot errors.
* Backport of some of the work in r71665 to trunk. This reworks much ofEric Smith2009-04-221-2/+12
| | | | | | | | | | | | | | | | | | | | | int, long, and float __format__(), and it keeps their implementation in sync with py3k. Also added PyOS_double_to_string. This is the "fallback" version that's also available in trunk, and should be kept in sync with that code. I'll add an issue to document PyOS_double_to_string in the C API. There are many internal cleanups. Externally visible changes include: - Implement PEP 378, Format Specifier for Thousands Separator, for floats, ints, and longs. - Issue #5515: 'n' formatting for ints, longs, and floats handles leading zero formatting poorly. - Issue #5772: For float.__format__, don't add a trailing ".0" if we're using no type code and we have an exponent.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-7/+7
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-7/+7
|
* Addresses issue 2802: 'n' formatting for integers.Eric Smith2008-05-111-0/+1
| | | | | | | | | | | | | | Adds 'n' as a format specifier for integers, to mirror the same specifier which is already available for floats. 'n' is the same as 'd', but inserts the current locale-specific thousands grouping. I added this as a stringlib function, but it's only used by str type, not unicode. This is because of an implementation detail in unicode.format(), which does its own str->unicode conversion. But the unicode version will be needed in 3.0, and it may be needed by other code eventually in 2.6 (maybe decimal?), so I left it as a stringlib implementation. As long as the unicode version isn't instantiated, there's no overhead for this.
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-171-0/+27
Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k).