summaryrefslogtreecommitdiffstats
path: root/Objects/stringlib
Commit message (Collapse)AuthorAgeFilesLines
* Refactor and clean up str.format() code (and helpers) in advance of ↵Eric Smith2008-05-301-69/+47
| | | | optimizations.
* Renamed PyString to PyBytesChristian Heimes2008-05-263-9/+9
|
* Addresses issue 2802: 'n' formatting for integers.Eric Smith2008-05-114-3/+150
| | | | | | | | | | | | | | 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.
* Bug #2388: Fix gcc warnings when compiling with --enable-unicode=ucs4.Martin v. Löwis2008-04-072-5/+24
|
* Merged revisions ↵Christian Heimes2008-03-262-0/+472
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray ........ r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line Copied files from py3k w/o modifications ........ r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines Take One * Added initialization code, warnings, flags etc. to the appropriate places * Added new buffer interface to string type * Modified tests * Modified Makefile.pre.in to compile the new files * Added bytesobject.c to Python.h ........ r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines Disabled bytearray.extend for now since it causes an infinite recursion Fixed serveral unit tests ........ r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines Added PyBytes support to several places: str + bytearray ord(bytearray) bytearray(str, encoding) ........ r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line Fixed more unit tests related to type('') is not unicode ........ r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines Fixed more unit tests Fixed bytearray.extend ........ r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line Implemented old buffer interface for bytearray ........ r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line Added backport of the io module ........ r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte ........ r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines Fixed more tests Fixed bytearray() comparsion with unicode() Fixed iterator assignment of bytearray ........ r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines str(bytesarray()) now returns the bytes and not the representation of the bytearray object Enabled and fixed more unit tests ........ r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines Clear error PyNumber_AsSsize_t() fails Use CHARMASK for ob_svall access disabled a test with memoryview again ........ r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line Untested updates to the PCBuild directory ........ r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed. ........ r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines Disabled last failing test I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out. ........ r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytes warning code ........ r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass. ........ r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytearray subclassing - all tests are passing. ........
* Issue 2264: empty float presentation type needs to have at least one digit ↵Eric Smith2008-03-171-1/+6
| | | | | | | | | past the decimal point. Added "Z" format_char to PyOS_ascii_formatd to support empty float presentation type. Renamed buf_size in PyOS_ascii_formatd to more accurately reflect it's meaning. Modified format.__float__ to use the new "Z" format as the default. Added test cases.
* Corrected assert to check for correct type in py3k.Eric Smith2008-02-241-1/+1
|
* Now that PyOS_ascii_formatd supports the 'n' format, simplify the float ↵Eric Smith2008-02-201-40/+15
| | | | formatting code to just call it.
* Added code to correct combining str and unicode in ''.format(). Added test ↵Eric Smith2008-02-181-0/+16
| | | | case.
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-174-0/+2273
| | | | | | | | | | | | | | | 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).
* Made _ParseTupleFinds only defined to unicodeobject.cFacundo Batista2007-11-161-0/+3
|
* Fix for stupid error (I need to remember to do a full 'make clean + make'Facundo Batista2007-11-161-1/+1
| | | | cycle before the tests...). Sorry.
* Now in find, rfind, index, and rindex, you can use None as defaults,Facundo Batista2007-11-161-0/+47
| | | | | | | | | | | | as usual with slicing (both with str and unicode strings). This fixes issue 1259. For str only the stringobject.c file was modified. But for unicode, I needed to repeat in the four functions a lot of code, so created a new function that does part of the job for them (and placed it in find.h, following a suggestion of Barry). Also added tests for this behaviour.
* Fix endcase for str.rpartition()Raymond Hettinger2006-09-041-4/+4
|
* changed count to return 0 for slices outside the source stringFredrik Lundh2006-05-301-1/+1
|
* changed find/rfind to return -1 for matches outside the source stringFredrik Lundh2006-05-301-10/+11
|
* fixed "abc".count("", 100) == -96 error (hopefully, nobody's relying onFredrik Lundh2006-05-291-1/+4
| | | | the current behaviour ;-)
* needforspeed: stringlib refactoring: changed find_obj to find_slice,Fredrik Lundh2006-05-271-18/+39
| | | | to enable use from stringobject
* needforspeed: replace improvements, changed to Py_LOCAL_INLINEFredrik Lundh2006-05-274-9/+9
| | | | where appropriate
* needforspeed: more stringlib refactoringFredrik Lundh2006-05-272-0/+62
|
* Fix Coverity warnings.Neal Norwitz2006-05-271-6/+1
| | | | | - Check the correct variable (str_obj, not str) for NULL - sep_len was already verified it wasn't 0
* needforspeed: stringlib refactoring: use stringlib/find for string findFredrik Lundh2006-05-261-6/+15
|
* needforspeed: stringlib refactoring, continued. added count andFredrik Lundh2006-05-263-4/+95
| | | | find helpers; updated unicodeobject to use stringlib_count
* needforspeed: added rpartition implementationFredrik Lundh2006-05-262-1/+68
|
* removed unnecessary includeFredrik Lundh2006-05-261-2/+0
|
* needforspeed: stringlib refactoring (in progress)Fredrik Lundh2006-05-261-0/+50
|
* needforspeed: stringlib refactoring (in progress)Fredrik Lundh2006-05-262-0/+102