Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Issue #14744: Use the new _PyUnicodeWriter internal API to speed up str%args ↵ | Victor Stinner | 2012-05-29 | 1 | -6/+89 |
| | | | | | | | | | | | | | | | | | and str.format(args) * Formatting string, int, float and complex use the _PyUnicodeWriter API. It avoids a temporary buffer in most cases. * Add _PyUnicodeWriter_WriteStr() to restore the PyAccu optimization: just keep a reference to the string if the output is only composed of one string * Disable overallocation when formatting the last argument of str%args and str.format(args) * Overallocation allocates at least 100 characters: add min_length attribute to the _PyUnicodeWriter structure * Add new private functions: _PyUnicode_FastCopyCharacters(), _PyUnicode_FastFill() and _PyUnicode_FromASCII() The speed up is around 20% in average. | ||||
* | Close #14648: Compute correctly maxchar in str.format() for substrin | Victor Stinner | 2012-04-23 | 1 | -0/+9 |
| | |||||
* | Close #14085: remove assertions from PyUnicode_WRITE macro | Victor Stinner | 2012-03-04 | 1 | -3/+0 |
| | | | | | Add checks in PyUnicode_WriteChar() and convert PyUnicode_New() assertion to a test raising a Python exception. | ||||
* | Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separator | Victor Stinner | 2012-02-23 | 1 | -15/+3 |
| | | | | | | | | | | | * Decode thousands separator and decimal point using PyUnicode_DecodeLocale() (from the locale encoding), instead of decoding them implicitly from latin1 * Remove _PyUnicode_InsertThousandsGroupingLocale(), it was not used * Change _PyUnicode_InsertThousandsGrouping() API to return the maximum character if unicode is NULL * Replace MIN/MAX macros by Py_MIN/Py_MAX * stringlib/undef.h undefines STRINGLIB_IS_UNICODE * stringlib/localeutil.h only supports Unicode | ||||
* | Issue #13706: Add assertions to detect bugs earlier | Victor Stinner | 2012-01-31 | 1 | -0/+3 |
| | |||||
* | Issue #13848: open() and the FileIO constructor now check for NUL characters ↵ | Antoine Pitrou | 2012-01-29 | 1 | -0/+6 |
|\ | | | | | | | | | | | in the file name. Patch by Hynek Schlawack. | ||||
| * | Issue #13848: open() and the FileIO constructor now check for NUL characters ↵ | Antoine Pitrou | 2012-01-29 | 1 | -0/+6 |
| | | | | | | | | | | | | in the file name. Patch by Hynek Schlawack. | ||||
* | | use the static identifier api for looking up special methods | Benjamin Peterson | 2012-01-22 | 1 | -29/+0 |
| | | | | | | | | | | I had to move the static identifier code from unicodeobject.h to object.h in order for this to work. | ||||
* | | add str.casefold() (closes #13752) | Benjamin Peterson | 2012-01-14 | 1 | -0/+5 |
| | | |||||
* | | Silence compilation warnings on Windows | Amaury Forgeot d'Arc | 2012-01-13 | 1 | -2/+2 |
| | | |||||
* | | use full unicode mappings for upper/lower/title case (#12736) | Benjamin Peterson | 2012-01-11 | 1 | -0/+23 |
| | | | | | | | | Also broaden the category of characters that count as lowercase/uppercase. | ||||
* | | Add a new PyUnicode_Fill() function | Victor Stinner | 2012-01-03 | 1 | -3/+20 |
| | | | | | | | | | | It is faster than the unicode_fill() function which was implemented in formatter_unicode.c. | ||||
* | | fix PyCompactUnicodeObject doc (test) | Victor Stinner | 2011-12-22 | 1 | -1/+1 |
| | | |||||
* | | backout 7876cd49300d: Move PyUnicode_WCHAR_KIND outside PyUnicode_Kind enum | Victor Stinner | 2011-12-19 | 1 | -4/+3 |
| | | |||||
* | | Move PyUnicode_WCHAR_KIND outside PyUnicode_Kind enum | Victor Stinner | 2011-12-17 | 1 | -3/+4 |
| | | |||||
* | | Issue #13560: Locale codec functions use the classic "errors" parameter, | Victor Stinner | 2011-12-17 | 1 | -3/+3 |
| | | | | | | | | | | | | instead of surrogateescape So it would be possible to support more error handlers later. | ||||
* | | Issue #13560: Add PyUnicode_EncodeLocale() | Victor Stinner | 2011-12-17 | 1 | -1/+11 |
| | | | | | | | | | | | | * Use PyUnicode_EncodeLocale() in time.strftime() if wcsftime() is not available * Document my last changes in Misc/NEWS | ||||
* | | Add PyUnicode_DecodeLocaleAndSize() and PyUnicode_DecodeLocale() | Victor Stinner | 2011-12-16 | 1 | -0/+22 |
| | | | | | | | | | | | | | | | | | | | | | | * PyUnicode_DecodeLocaleAndSize() and PyUnicode_DecodeLocale() decode a string from the current locale encoding * _Py_char2wchar() writes an "error code" in the size argument to indicate if the function failed because of memory allocation failure or because of a decoding error. The function doesn't write the error message directly to stderr. * Fix time.strftime() (if wcsftime() is missing): decode strftime() result from the current locale encoding, not from the filesystem encoding. | ||||
* | | PyUnicode_Resize(): warn about canonical representation | Victor Stinner | 2011-12-12 | 1 | -1/+4 |
| | | | | | | | | Call also directly unicode_resize() in unicodeobject.c | ||||
* | | Fix PyUnicode_Resize() for compact string: leave the string unchanged on error | Victor Stinner | 2011-12-12 | 1 | -8/+5 |
| | | | | | | | | Fix also PyUnicode_Resize() doc | ||||
* | | Make PyUnicode_Copy() private => _PyUnicode_Copy() | Victor Stinner | 2011-12-12 | 1 | -1/+3 |
| | | | | | | | | | | | | Undocument the function. Make also decode_utf8_errors() as private (static). | ||||
* | | resize_copy() now supports legacy ready strings | Victor Stinner | 2011-12-11 | 1 | -0/+4 |
| | | |||||
* | | PyUnicode_IS_ASCII() macro ensures that the string is ready | Victor Stinner | 2011-12-12 | 1 | -5/+7 |
| | | | | | | | | It has no sense to check if a not ready string is ASCII or not. | ||||
* | | Py_UNICODE_HIGH_SURROGATE() and Py_UNICODE_LOW_SURROGATE() macros | Victor Stinner | 2011-11-29 | 1 | -0/+4 |
| | | | | | | | | And use surrogates macros everywhere in unicodeobject.c | ||||
* | | PyUnicode_GET_SIZE() checks that PyUnicode_AsUnicode() succeed | Victor Stinner | 2011-11-21 | 1 | -6/+7 |
| | | | | | | | | using an assertion | ||||
* | | _PyUnicode_CheckConsistency() also checks maxchar maximum value, | Victor Stinner | 2011-11-20 | 1 | -5/+8 |
| | | | | | | | | not only its minimum value | ||||
* | | Fix PyUnicode_CopyCharacters() doc | Victor Stinner | 2011-11-20 | 1 | -2/+1 |
| | | |||||
* | | Ensure that Py_UCS4 is 32 bits and Py_UCS2 is 16 bits | Victor Stinner | 2011-11-20 | 1 | -2/+7 |
| | | |||||
* | | Fix misused of "PyUnicodeObject" structure name in unicodeobject.h | Victor Stinner | 2011-11-16 | 1 | -2/+2 |
| | | |||||
* | | Port encoders from Py_UNICODE API to unicode object API. | Martin v. Löwis | 2011-11-10 | 1 | -0/+16 |
| | | |||||
* | | Make _PyUnicode_FromId return borrowed references. | Martin v. Löwis | 2011-11-07 | 1 | -1/+1 |
| | | | | | | | | http://mail.python.org/pipermail/python-dev/2011-November/114347.html | ||||
* | | Fix gdb/libpython.py for not ready Unicode strings | Victor Stinner | 2011-11-04 | 1 | -3/+5 |
| | | | | | | | | | | _PyUnicode_CheckConsistency() checks also hash and length value for not ready Unicode strings. | ||||
* | | Replace PyUnicodeObject type by PyObject | Victor Stinner | 2011-11-03 | 1 | -2/+1 |
| | | | | | | | | | | * _PyUnicode_CheckConsistency() now takes a PyObject* instead of void* * Remove now useless casts to PyObject* | ||||
* | | Port UCS1 and charmap codecs to new API. | Martin v. Löwis | 2011-11-02 | 1 | -0/+6 |
| | | |||||
* | | Drop Py_UCS4_ functions. Closes #13246. | Martin v. Löwis | 2011-10-31 | 1 | -37/+0 |
| | | |||||
* | | Replace PyUnicodeObject* by PyObject* where it was irrevelant | Victor Stinner | 2011-10-23 | 1 | -1/+1 |
| | | | | | | | | | | | | A Unicode string can now be a PyASCIIObject, PyCompactUnicodeObject or PyUnicodeObject. Aliasing a PyASCIIObject* or PyCompactUnicodeObject* to PyUnicodeObject* is wrong | ||||
* | | Simplify _PyUnicode_COMPACT_DATA() macro | Victor Stinner | 2011-10-18 | 1 | -1/+1 |
| | | |||||
* | | Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore | Victor Stinner | 2011-10-18 | 1 | -1/+15 |
| | | | | | | | | | | error handlers on all Windows versions. The MBCS codec is now supporting all error handlers, instead of only replace to encode and ignore to decode. | ||||
* | | Rename _Py_identifier to _Py_IDENTIFIER. | Martin v. Löwis | 2011-10-14 | 1 | -2/+2 |
| | | |||||
* | | Simplify PyUnicode_MAX_CHAR_VALUE | Victor Stinner | 2011-10-12 | 1 | -6/+5 |
| | | | | | | | | | | | | | | Use PyUnicode_IS_ASCII instead of PyUnicode_IS_COMPACT_ASCII, so the following test can be removed: PyUnicode_DATA(op) == (((PyCompactUnicodeObject *)(op))->utf8) | ||||
* | | Drop extra semicolon. | Martin v. Löwis | 2011-10-09 | 1 | -1/+1 |
| | | |||||
* | | Add API for static strings, primarily good for identifiers. | Martin v. Löwis | 2011-10-09 | 1 | -0/+34 |
| | | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing. | ||||
* | | Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE. | Martin v. Löwis | 2011-10-07 | 1 | -25/+10 |
| | | |||||
* | | Update C API docs for PEP 393. | Georg Brandl | 2011-10-07 | 1 | -1/+1 |
| | | |||||
* | | Fix PyUnicode_CHARACTER_SIZE and PyUnicode_KIND_SIZE | Victor Stinner | 2011-10-06 | 1 | -2/+2 |
| | | |||||
* | | Fix compilation warnings under 64-bit Windows | Antoine Pitrou | 2011-10-06 | 1 | -2/+3 |
| | | |||||
* | | Branch merge | Éric Araujo | 2011-10-06 | 1 | -1/+1 |
|\ \ | |||||
| * | | Fix typo | Éric Araujo | 2011-10-04 | 1 | -1/+1 |
| | | | |||||
* | | | rephrase PyUnicode_1BYTE_KIND documentation | Victor Stinner | 2011-10-05 | 1 | -6/+7 |
| | | | |||||
* | | | Don't check for the maximum character when copying from unicodeobject.c | Victor Stinner | 2011-10-05 | 1 | -0/+7 |
| | | | | | | | | | | | | | | | | | | | | | | | | * Create copy_characters() function which doesn't check for the maximum character in release mode * _PyUnicode_CheckConsistency() is no more static to be able to use it in _PyUnicode_FormatAdvanced() (in formatter_unicode.c) * _PyUnicode_CheckConsistency() checks the string hash |