Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | | Relax _PyBytesWriter API | Victor Stinner | 2015-10-12 | 1 | -8/+7 | |
| | | | | | | | | | | | | | | | | | | | | | Don't require _PyBytesWriter pointer to be a "char *". Same change for _PyBytesWriter_WriteBytes() parameter. For example, binascii uses "unsigned char*". | |||||
* | | | Issue #25349: Add fast path for b'%c' % int | Victor Stinner | 2015-10-09 | 1 | -10/+15 | |
| | | | | | | | | | | | | Optimize also %% formater. | |||||
* | | | Issue #25349: Optimize bytes % int | Victor Stinner | 2015-10-09 | 1 | -0/+36 | |
| | | | | | | | | | | | | | | | | | | | | | | | | Optimize bytes.__mod__(args) for integere formats: %d (%i, %u), %o, %x and %X. _PyBytesWriter is now used to format directly the integer into the writer buffer, instead of using a temporary bytes object. Formatting is between 30% and 50% faster on a microbenchmark. | |||||
* | | | Add _PyBytesWriter_WriteBytes() to factorize the code | Victor Stinner | 2015-10-09 | 1 | -0/+14 | |
| | | | ||||||
* | | | _PyBytesWriter: simplify code to avoid "prealloc" parameters | Victor Stinner | 2015-10-09 | 1 | -9/+7 | |
| | | | | | | | | | | | | | | | Substract preallocate bytes from min_size before calling _PyBytesWriter_Prepare(). | |||||
* | | | _PyBytesWriter: rename size attribute to min_size | Victor Stinner | 2015-10-09 | 1 | -7/+7 | |
| | | | ||||||
* | | | Issue #25349: Optimize bytes % args using the new private _PyBytesWriter API | Victor Stinner | 2015-10-09 | 1 | -59/+128 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Thanks to the _PyBytesWriter API, output smaller than 512 bytes are allocated on the stack and so avoid calling _PyBytes_Resize(). Because of that, change the default buffer size to fmtcnt instead of fmtcnt+100. * Rely on _PyBytesWriter algorithm to overallocate the buffer instead of using a custom code. For example, _PyBytesWriter uses a different overallocation factor (25% or 50%) depending on the platform to get best performances. * Disable overallocation for the last write. * Replace C loops to fill characters with memset() * Add also many comments to _PyBytes_Format() * Remove unused FORMATBUFLEN constant * Avoid the creation of a temporary bytes object when formatting a floating point number (when no custom formatting option is used) * Fix also reference leaks on error handling * Use Py_MEMCPY() to copy bytes between two formatters (%) | |||||
* | | | Issue #25318: cleanup code _PyBytesWriter | Victor Stinner | 2015-10-09 | 1 | -17/+17 | |
| | | | | | | | | | | | | | | | | | | Rename "stack buffer" to "small buffer". Add also an assertion in _PyBytesWriter_GetPos(). | |||||
* | | | Issue #25318: Fix compilation error | Victor Stinner | 2015-10-09 | 1 | -1/+1 | |
| | | | | | | | | | | | | Replace "#if Py_DEBUG" with "#ifdef Py_DEBUG". | |||||
* | | | Issue #25318: Move _PyBytesWriter to bytesobject.c | Victor Stinner | 2015-10-08 | 1 | -0/+193 | |
|/ / | | | | | | | Declare also the private API in bytesobject.h. | |||||
* | | Issue #23573: Restored optimization of bytes.rfind() and bytearray.rfind() | Serhiy Storchaka | 2015-07-20 | 1 | -3/+7 | |
| | | | | | | | | for single-byte argument on Linux. | |||||
* | | Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(), | Serhiy Storchaka | 2015-05-30 | 1 | -11/+22 | |
|\ \ | |/ | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly. | |||||
| * | Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(), | Serhiy Storchaka | 2015-05-30 | 1 | -7/+13 | |
| | | | | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly. | |||||
* | | Specify default values of semantic booleans in Argument Clinic generated ↵ | Serhiy Storchaka | 2015-05-30 | 1 | -2/+2 | |
| | | | | | | | | signatures as booleans. | |||||
* | | Implements issue #9951: Adds a hex() method to bytes, bytearray, & memoryview. | Gregory P. Smith | 2015-04-25 | 1 | -0/+16 | |
| | | | | | | | | | | | | | | Also updates a few internal implementations of the same thing to use the new built-in code. Contributed by Arnon Yaari. | |||||
* | | Remove local dead code. In both blocks dir is always greater 0. | Christian Heimes | 2015-04-18 | 1 | -2/+1 | |
| | | ||||||
* | | Issue #23944: Argument Clinic now wraps long impl prototypes at column 78. | Larry Hastings | 2015-04-14 | 1 | -6/+9 | |
| | | ||||||
* | | Issue #23501: Argumen Clinic now generates code into separate files by default. | Serhiy Storchaka | 2015-04-03 | 1 | -506/+16 | |
| | | ||||||
* | | Issue #23466: Raised OverflowError if %c argument is out of range. | Serhiy Storchaka | 2015-04-03 | 1 | -3/+8 | |
| | | ||||||
* | | Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on | Serhiy Storchaka | 2015-03-30 | 1 | -26/+55 | |
| | | | | | | | | non-integer input. | |||||
* | | Issue #23573: Fix bytes.rfind() and bytearray.rfind() on Windows | Victor Stinner | 2015-03-25 | 1 | -1/+2 | |
| | | | | | | | | | | | | | | Windows has no memrchr() function. This change is only a workaround, the optimization must be reenabled on other platforms. | |||||
* | | Issue #23573: Increased performance of string search operations (str.find, | Serhiy Storchaka | 2015-03-24 | 1 | -9/+24 | |
| | | | | | | | | | | str.index, str.count, the in operator, str.split, str.partition) with arguments of different kinds (UCS1, UCS2, UCS4). | |||||
* | | Issue #23681: The -b option now affects comparisons of bytes with int. | Serhiy Storchaka | 2015-03-20 | 1 | -8/+17 | |
| | | ||||||
* | | Close issue23467: add %r compatibility to bytes and bytearray | Ethan Furman | 2015-03-11 | 1 | -0/+2 | |
| | | ||||||
* | | Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵ | Antoine Pitrou | 2015-03-10 | 1 | -37/+0 | |
|\ \ | |/ | | | | | objects. | |||||
| * | Issue #23629: Fix the default __sizeof__ implementation for variable-sized ↵ | Antoine Pitrou | 2015-03-10 | 1 | -14/+0 | |
| | | | | | | | | objects. | |||||
* | | Issue #23450: Fixed possible integer overflows. | Serhiy Storchaka | 2015-02-16 | 1 | -1/+1 | |
| | | ||||||
* | | Issue #23383: Cleaned up bytes formatting. | Serhiy Storchaka | 2015-02-10 | 1 | -140/+51 | |
| | | ||||||
* | | Issue #22896: Fixed using _getbuffer() in recently added _PyBytes_Format(). | Serhiy Storchaka | 2015-02-02 | 1 | -3/+2 | |
| | | ||||||
* | | Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer() | Serhiy Storchaka | 2015-02-02 | 1 | -116/+146 | |
|\ \ | |/ | | | | | and PyObject_AsWriteBuffer(). | |||||
| * | Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer() | Serhiy Storchaka | 2015-02-02 | 1 | -89/+82 | |
| | | | | | | | | and PyObject_AsWriteBuffer(). | |||||
* | | Issue #20284: Fix a compilation warning on Windows | Victor Stinner | 2015-01-26 | 1 | -1/+1 | |
| | | | | | | | | Explicitly cast the long to char. | |||||
* | | ensure ilen is initialized when it is assigned to len | Benjamin Peterson | 2015-01-26 | 1 | -1/+1 | |
| | | ||||||
* | | Issue20284: Implement PEP461 | Ethan Furman | 2015-01-24 | 1 | -7/+650 | |
| | | ||||||
* | | Issue #20335: bytes constructor now raises TypeError when encoding or errors | Serhiy Storchaka | 2014-12-02 | 1 | -7/+7 | |
|\ \ | |/ | | | | | is specified with non-string argument. Based on patch by Renaud Blanch. | |||||
| * | Issue #20335: bytes constructor now raises TypeError when encoding or errors | Serhiy Storchaka | 2014-12-02 | 1 | -7/+7 | |
| | | | | | | | | is specified with non-string argument. Based on patch by Renaud Blanch. | |||||
* | | Issue #22615: Argument Clinic now supports the "type" argument for the | Larry Hastings | 2014-10-13 | 1 | -1/+1 | |
| | | | | | | | | | | int converter. This permits using the int converter with enums and typedefs. | |||||
* | | #16518: Bring error messages in harmony with docs ("bytes-like object") | R David Murray | 2014-10-05 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | Some time ago we changed the docs to consistently use the term 'bytes-like object' in all the contexts where bytes, bytearray, memoryview, etc are used. This patch (by Ezio Melotti) completes that work by changing the error messages that previously reported that certain types did "not support the buffer interface" to instead say that a bytes-like object is required. (The glossary entry for bytes-like object references the discussion of the buffer protocol in the docs.) | |||||
* | | merge 3.4 | Benjamin Peterson | 2014-09-29 | 1 | -1/+1 | |
|\ \ | |/ | ||||||
| * | merge 3.3 | Benjamin Peterson | 2014-09-29 | 1 | -1/+1 | |
| |\ | ||||||
| | * | these variables ought to be Py_ssize_t | Benjamin Peterson | 2014-09-29 | 1 | -1/+1 | |
| | | | ||||||
* | | | merge 3.4 (#22519) | Benjamin Peterson | 2014-09-29 | 1 | -12/+16 | |
|\ \ \ | |/ / | ||||||
| * | | merge 3.3 (closes #22519) | Benjamin Peterson | 2014-09-29 | 1 | -12/+16 | |
| |\ \ | | |/ | ||||||
| | * | fix overflow checking in PyBytes_Repr (closes #22519) | Benjamin Peterson | 2014-09-29 | 1 | -12/+16 | |
| | | | ||||||
* | | | Removed redundant casts to `char *`. | Serhiy Storchaka | 2014-09-28 | 1 | -1/+1 | |
| | | | | | | | | | | | | Corresponding functions now accept `const char *` (issue #1772673). | |||||
* | | | Issue #22215: Now ValueError is raised instead of TypeError when str or bytes | Serhiy Storchaka | 2014-09-06 | 1 | -2/+2 | |
| | | | | | | | | | | | | argument contains not permitted null character or byte. | |||||
* | | | Issue #22207: Fix "comparison between signed and unsigned integers" warning in | Victor Stinner | 2014-08-17 | 1 | -3/+4 | |
| | | | | | | | | | | | | | | | test checking for integer overflow on Py_ssize_t type: cast explicitly to size_t. | |||||
* | | | Optimize PyBytes_FromObject(): only overallocate when size=0 to not get the | Victor Stinner | 2014-08-17 | 1 | -1/+3 | |
| | | | | | | | | | | | | empty string singleton | |||||
* | | | Issue #22077: Improve index error messages for bytearrays, bytes, lists, and | Terry Jan Reedy | 2014-08-02 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | tuples by adding 'or slices'. Added ', not <typename' for bytearrays. Original patch by Claudiu Popa. | |||||
* | | | Rerun AC, silence pointer conversion warnings. | Martin v. Löwis | 2014-07-27 | 1 | -71/+100 | |
| | | |