summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* When expandtabs() would be a no-op, don't create a duplicate stringAntoine Pitrou2011-10-041-0/+7
|
* Migrate str.expandtabs to the new APIAntoine Pitrou2011-10-041-48/+39
|
* fix parensBenjamin Peterson2011-10-031-1/+1
|
* fix formattingBenjamin Peterson2011-10-031-2/+2
|
* fix compiler warningsBenjamin Peterson2011-10-031-3/+9
|
* Move in-place Unicode append to its own subfunctionVictor Stinner2011-10-031-38/+54
|
* Reindent internal Unicode macrosVictor Stinner2011-10-031-7/+14
|
* Document utf8_length and wstr_length statesVictor Stinner2011-10-031-40/+44
| | | | Ensure these states with assertions in _PyUnicode_CheckConsistency().
* resize_inplace() sets utf8_length to zero if the utf8 is not shared8Victor Stinner2011-10-031-23/+28
| | | | Cleanup also the code.
* PyUnicode_New() sets utf8_length to zero for latin1Victor Stinner2011-10-031-2/+5
|
* Unicode: raise SystemError instead of ValueError or RuntimeError on invalidVictor Stinner2011-10-031-6/+6
| | | | state
* Unicode: document when the wstr pointer is shared with dataVictor Stinner2011-10-031-1/+23
| | | | Add also related assertions to _PyUnicode_CheckConsistency().
* Add _PyUnicode_HAS_WSTR_MEMORY() macroVictor Stinner2011-10-031-5/+10
|
* PyUnicode_Join() checks output length in debug modeVictor Stinner2011-10-031-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 Stinner2011-10-031-8/+14
| | | | | Don't check PyUnicode_CopyCharacters() in release mode. Rename also some variables.
* Improve string forms and PyUnicode_Resize() documentationVictor Stinner2011-10-031-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 2Victor Stinner2011-10-031-13/+7
|
* _PyUnicode_CheckConsistency() checks utf8 field consistencyVictor Stinner2011-10-031-0/+6
|
* unicode_subtype_new() copies also the ascii flagVictor Stinner2011-10-031-1/+1
|
* unicode_kind_name() doesn't check consistency anymoreVictor Stinner2011-10-031-1/+2
| | | | It is is called from _PyUnicode_Dump() and so must not fail.
* PyUnicode_Ready() now sets ascii=1 if maxchar < 128Victor Stinner2011-10-031-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 singletonVictor Stinner2011-10-031-22/+72
| | | | Only use _PyUnicode_READY_REPLACE() on just created strings.
* Fix resize_compact() and resize_inplace(); reenable full resize optimizationsVictor Stinner2011-10-031-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 optimizationVictor Stinner2011-10-031-3/+0
|
* _PyUnicode_Dump() indicates if wstr and/or utf8 are sharedVictor Stinner2011-10-031-15/+16
|
* Fix resize_inplace(): update shared utf8 pointerVictor Stinner2011-10-031-1/+4
|
* Disable unicode_resize() optimization on Windows (16-bit wchar_t)Victor Stinner2011-10-031-0/+4
|
* _PyUnicode_Ready() for 16-bit wchar_tVictor Stinner2011-10-031-0/+2
|
* Fix compilation error on WindowsVictor Stinner2011-10-031-2/+3
| | | | Fix also a compiler warning.
* Use PyUnicode_WCHAR_KIND to check if a string is a wstr stringVictor Stinner2011-10-031-9/+11
| | | | Simplify the test in wstr pointer in unicode_sizeof().
* Add _PyUnicode_CheckConsistency() macro to help debuggingVictor Stinner2011-10-031-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 orVictor Stinner2011-10-031-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 possibleVictor Stinner2011-10-031-10/+71
|
* Rewrite PyUnicode_Resize()Victor Stinner2011-10-031-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() macroVictor Stinner2011-10-021-6/+11
|
* Write _PyUnicode_Dump() to help debuggingVictor Stinner2011-10-031-0/+23
|
* PyUnicode_CopyCharacters() fails when copying latin1 into asciiVictor Stinner2011-10-021-7/+56
|
* unicode_convert_wchar_to_ucs4() cannot failVictor Stinner2011-10-021-10/+4
|
* Add _PyUnicode_DATA_ANY(op) private macroVictor Stinner2011-10-021-17/+17
|
* unicode_empty and unicode_latin1 are PyObject* objects, not PyUnicodeObject*Victor Stinner2011-10-021-15/+15
|
* PyUnicode_FindChar() raises a IndexError on invalid indexVictor Stinner2011-10-011-0/+4
|
* Optimize _PyUnicode_AsKind() for UCS1->UCS4 and UCS2->UCS4Victor Stinner2011-10-011-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 Stinner2011-10-011-1/+1
|
* PyUnicode_WriteChar() raises IndexError on invalid indexVictor Stinner2011-10-011-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 invalidVictor Stinner2011-10-011-14/+11
| | | | unicode_getitem() reuses PyUnicode_ReadChar()
* PyUnicode_FromKindAndData() raises a ValueError if the kind is unknownVictor Stinner2011-10-011-1/+1
|
* Optimize unicode_subtype_new(): don't encode to wchar_t and decode from wchar_tVictor Stinner2011-10-011-42/+77
| | | | Rewrite unicode_subtype_new(): allocate directly the right type.
* Add _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() macrosVictor Stinner2011-10-011-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öwis2011-10-011-0/+1
|
* merge headsBenjamin Peterson2011-10-011-3/+6
|\