Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | When expandtabs() would be a no-op, don't create a duplicate string | Antoine Pitrou | 2011-10-04 | 1 | -0/+7 |
| | |||||
* | Migrate str.expandtabs to the new API | Antoine Pitrou | 2011-10-04 | 1 | -48/+39 |
| | |||||
* | fix parens | Benjamin Peterson | 2011-10-03 | 1 | -1/+1 |
| | |||||
* | fix formatting | Benjamin Peterson | 2011-10-03 | 1 | -2/+2 |
| | |||||
* | fix compiler warnings | Benjamin Peterson | 2011-10-03 | 1 | -3/+9 |
| | |||||
* | Move in-place Unicode append to its own subfunction | Victor Stinner | 2011-10-03 | 1 | -38/+54 |
| | |||||
* | Reindent internal Unicode macros | Victor Stinner | 2011-10-03 | 1 | -7/+14 |
| | |||||
* | Document utf8_length and wstr_length states | Victor Stinner | 2011-10-03 | 1 | -40/+44 |
| | | | | Ensure these states with assertions in _PyUnicode_CheckConsistency(). | ||||
* | resize_inplace() sets utf8_length to zero if the utf8 is not shared8 | Victor Stinner | 2011-10-03 | 1 | -23/+28 |
| | | | | Cleanup also the code. | ||||
* | PyUnicode_New() sets utf8_length to zero for latin1 | Victor Stinner | 2011-10-03 | 1 | -2/+5 |
| | |||||
* | Unicode: raise SystemError instead of ValueError or RuntimeError on invalid | Victor Stinner | 2011-10-03 | 1 | -6/+6 |
| | | | | state | ||||
* | Unicode: document when the wstr pointer is shared with data | Victor Stinner | 2011-10-03 | 1 | -1/+23 |
| | | | | Add also related assertions to _PyUnicode_CheckConsistency(). | ||||
* | Add _PyUnicode_HAS_WSTR_MEMORY() macro | Victor Stinner | 2011-10-03 | 1 | -5/+10 |
| | |||||
* | PyUnicode_Join() checks output length in debug mode | Victor Stinner | 2011-10-03 | 1 | -9/+21 |
| | | | | | | | | PyUnicode_CopyCharacters() may copies less character than requested size, if the input string is smaller than the argument. (This is very unlikely, but who knows!?) Avoid also calling PyUnicode_CopyCharacters() if the string is empty. | ||||
* | Fix a compiler warning in PyUnicode_Append() | Victor Stinner | 2011-10-03 | 1 | -8/+14 |
| | | | | | Don't check PyUnicode_CopyCharacters() in release mode. Rename also some variables. | ||||
* | Improve string forms and PyUnicode_Resize() documentation | Victor Stinner | 2011-10-03 | 1 | -2/+2 |
| | | | | | Remove also the FIXME for resize_copy(): as discussed with Martin, copy the string on resize if the string is not resizable is just fine. | ||||
* | Simplify unicode_resizable(): singletons reference count is at least 2 | Victor Stinner | 2011-10-03 | 1 | -13/+7 |
| | |||||
* | _PyUnicode_CheckConsistency() checks utf8 field consistency | Victor Stinner | 2011-10-03 | 1 | -0/+6 |
| | |||||
* | unicode_subtype_new() copies also the ascii flag | Victor Stinner | 2011-10-03 | 1 | -1/+1 |
| | |||||
* | unicode_kind_name() doesn't check consistency anymore | Victor Stinner | 2011-10-03 | 1 | -1/+2 |
| | | | | It is is called from _PyUnicode_Dump() and so must not fail. | ||||
* | PyUnicode_Ready() now sets ascii=1 if maxchar < 128 | Victor Stinner | 2011-10-03 | 1 | -15/+14 |
| | | | | | ascii=1 is no more reserved to PyASCIIObject. Use PyUnicode_IS_COMPACT_ASCII(obj) to check if obj is a PyASCIIObject (as before). | ||||
* | Create _PyUnicode_READY_REPLACE() to reuse singleton | Victor Stinner | 2011-10-03 | 1 | -22/+72 |
| | | | | Only use _PyUnicode_READY_REPLACE() on just created strings. | ||||
* | Fix resize_compact() and resize_inplace(); reenable full resize optimizations | Victor Stinner | 2011-10-03 | 1 | -10/+21 |
| | | | | | | * resize_compact() updates also wstr_len for non-ascii strings sharing wstr * resize_inplace() updates also utf8_len/wstr_len for strings sharing utf8/wstr | ||||
* | resize_inplace() has been fixed: reenable this optimization | Victor Stinner | 2011-10-03 | 1 | -3/+0 |
| | |||||
* | _PyUnicode_Dump() indicates if wstr and/or utf8 are shared | Victor Stinner | 2011-10-03 | 1 | -15/+16 |
| | |||||
* | Fix resize_inplace(): update shared utf8 pointer | Victor Stinner | 2011-10-03 | 1 | -1/+4 |
| | |||||
* | Disable unicode_resize() optimization on Windows (16-bit wchar_t) | Victor Stinner | 2011-10-03 | 1 | -0/+4 |
| | |||||
* | _PyUnicode_Ready() for 16-bit wchar_t | Victor Stinner | 2011-10-03 | 1 | -0/+2 |
| | |||||
* | Fix compilation error on Windows | Victor Stinner | 2011-10-03 | 1 | -2/+3 |
| | | | | Fix also a compiler warning. | ||||
* | Use PyUnicode_WCHAR_KIND to check if a string is a wstr string | Victor Stinner | 2011-10-03 | 1 | -9/+11 |
| | | | | Simplify the test in wstr pointer in unicode_sizeof(). | ||||
* | Add _PyUnicode_CheckConsistency() macro to help debugging | Victor Stinner | 2011-10-03 | 1 | -37/+98 |
| | | | | | | * Document Unicode string states * Use _PyUnicode_CheckConsistency() to ensure that objects are always consistent. | ||||
* | In release mode, PyUnicode_InternInPlace() does nothing if the input is NULL or | Victor Stinner | 2011-10-03 | 1 | -3/+7 |
| | | | | | | not a unicode, instead of failing with a fatal error. Use assertions in debug mode (provide better error messages). | ||||
* | PyUnicode_Append() now works in-place when it's possible | Victor Stinner | 2011-10-03 | 1 | -10/+71 |
| | |||||
* | Rewrite PyUnicode_Resize() | Victor Stinner | 2011-10-03 | 1 | -95/+207 |
| | | | | | | | | * Rename _PyUnicode_Resize() to unicode_resize() * unicode_resize() creates a copy if the string cannot be resized instead of failing * Optimize resize_copy() for wstr strings * Disable temporary resize_inplace() | ||||
* | Add _PyUnicode_HAS_UTF8_MEMORY() macro | Victor Stinner | 2011-10-02 | 1 | -6/+11 |
| | |||||
* | Write _PyUnicode_Dump() to help debugging | Victor Stinner | 2011-10-03 | 1 | -0/+23 |
| | |||||
* | PyUnicode_CopyCharacters() fails when copying latin1 into ascii | Victor Stinner | 2011-10-02 | 1 | -7/+56 |
| | |||||
* | unicode_convert_wchar_to_ucs4() cannot fail | Victor Stinner | 2011-10-02 | 1 | -10/+4 |
| | |||||
* | Add _PyUnicode_DATA_ANY(op) private macro | Victor Stinner | 2011-10-02 | 1 | -17/+17 |
| | |||||
* | unicode_empty and unicode_latin1 are PyObject* objects, not PyUnicodeObject* | Victor Stinner | 2011-10-02 | 1 | -15/+15 |
| | |||||
* | PyUnicode_FindChar() raises a IndexError on invalid index | Victor Stinner | 2011-10-01 | 1 | -0/+4 |
| | |||||
* | Optimize _PyUnicode_AsKind() for UCS1->UCS4 and UCS2->UCS4 | Victor Stinner | 2011-10-01 | 1 | -25/+43 |
| | | | | | * Ensure that the input string is ready * Raise a ValueError instead of of a fatal error | ||||
* | Fix usage of PyUnicode_READY() in PyUnicode_GetLength() | Victor Stinner | 2011-10-01 | 1 | -1/+1 |
| | |||||
* | PyUnicode_WriteChar() raises IndexError on invalid index | Victor Stinner | 2011-10-01 | 1 | -7/+21 |
| | | | | | PyUnicode_WriteChar() raises also a ValueError if the string has more than 1 reference. | ||||
* | PyUnicode_ReadChar() raises a IndexError if the index in invalid | Victor Stinner | 2011-10-01 | 1 | -14/+11 |
| | | | | unicode_getitem() reuses PyUnicode_ReadChar() | ||||
* | PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown | Victor Stinner | 2011-10-01 | 1 | -1/+1 |
| | |||||
* | Optimize unicode_subtype_new(): don't encode to wchar_t and decode from wchar_t | Victor Stinner | 2011-10-01 | 1 | -42/+77 |
| | | | | Rewrite unicode_subtype_new(): allocate directly the right type. | ||||
* | Add _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() macros | Victor Stinner | 2011-10-01 | 1 | -41/+54 |
| | | | | | | * Rename existing _PyUnicode_UTF8() macro to PyUnicode_UTF8() * Rename existing _PyUnicode_UTF8_LENGTH() macro to PyUnicode_UTF8_LENGTH() * PyUnicode_UTF8() and PyUnicode_UTF8_LENGTH() are more strict | ||||
* | Issue 13085: Fix some memory leaks. Patch by Stefan Krah. | Martin v. Löwis | 2011-10-01 | 1 | -0/+1 |
| | |||||
* | merge heads | Benjamin Peterson | 2011-10-01 | 1 | -3/+6 |
|\ |