summaryrefslogtreecommitdiff
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
| | | | | | | * | | | | | | | | | | Issue #25318: cleanup code _PyBytesWriterVictor Stinner2015-10-091-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename "stack buffer" to "small buffer". Add also an assertion in _PyBytesWriter_GetPos().
| | | | | | | * | | | | | | | | | | Issue #25318: Fix backslashreplace()Victor Stinner2015-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix code to estimate the needed space.
| | | | | | | * | | | | | | | | | | Issue #25318: Avoid sprintf() in backslashreplace()Victor Stinner2015-10-091-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite backslashreplace() to be closer to PyCodec_BackslashReplaceErrors(). Add also unit tests for non-BMP characters.
| | | | | | | * | | | | | | | | | | Issue #25318: Fix compilation errorVictor Stinner2015-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace "#if Py_DEBUG" with "#ifdef Py_DEBUG".
| | | | | | | * | | | | | | | | | | Issue #25318: Move _PyBytesWriter to bytesobject.cVictor Stinner2015-10-092-210/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare also the private API in bytesobject.h.
| | | | | | | * | | | | | | | | | | Optimize backslashreplace error handlerVictor Stinner2015-10-092-51/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25318: Optimize backslashreplace and xmlcharrefreplace error handlers in UTF-8 encoder. Optimize also backslashreplace error handler for ASCII and Latin1 encoders. Use the new _PyBytesWriter API to optimize these error handlers for the encoders. It avoids to create an exception and call the slow implementation of the error handler.
| | | | | | | * | | | | | | | | | | Issue #25318: Add _PyBytesWriter APIVictor Stinner2015-10-092-132/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new private API to optimize Unicode encoders. It uses a small buffer allocated on the stack and supports overallocation. Use _PyBytesWriter API for UCS1 (ASCII and Latin1) and UTF-8 encoders. Enable overallocation for the UTF-8 encoder with error handlers. unicode_encode_ucs1(): initialize collend to collstart+1 to not check the current character twice, we already know that it is not ASCII.
| | | | | | | * | | | | | | | | | | Merge typo fixes from 3.5Martin Panter2015-10-076-418/+674
| | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | * \ \ \ \ \ \ \ \ \ \ merge 3.5 (closes #24806)Benjamin Peterson2015-10-067-419/+675
| | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | * | | | | | | | | | | Issue #25301: Fix compatibility with ISO C90Victor Stinner2015-10-051-1/+5
| | | | | | | | | | | | | | | | | | | |
| | | | | | | | | * | | | | | | | | | | Issue #25301: The UTF-8 decoder is now up to 15 times as fast for errorVictor Stinner2015-10-051-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handlers: ``ignore``, ``replace`` and ``surrogateescape``.
| | | | | | | | | * | | | | | | | | | | Fix _PyUnicodeWriter_PrepareKind()Victor Stinner2015-10-031-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize kind to 0 (PyUnicode_WCHAR_KIND) to ensure that _PyUnicodeWriter_PrepareKind() handles correctly read-only buffer: copy the buffer.
| | | | | | | | | * | | | | | | | | | | Issue #24848: Fixed bugs in UTF-7 decoding of misformed data:Serhiy Storchaka2015-10-027-403/+614
| | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Non-ASCII bytes were accepted after shift sequence. 2. A low surrogate could be emitted in case of error in high surrogate. 3. In some circumstances the '\xfd' character was produced instead of the replacement character '\ufffd' (due to a bug in _PyUnicodeWriter).
| | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Issue #24483: C implementation of functools.lru_cache() now calculates key'sSerhiy Storchaka2015-10-021-0/+37
| | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hash only once.
| | | | | | | | | | * | | | | | | | | | | | Make _PyUnicode_TranslateCharmap() symbol privateVictor Stinner2015-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unicodeobject.h exposes PyUnicode_TranslateCharmap() and PyUnicode_Translate().
| | | | | | | | | | * | | | | | | | | | | | Issue #25267: The UTF-8 encoder is now up to 75 times as fast for errorVictor Stinner2015-10-012-53/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handlers: ``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass``. Patch co-written with Serhiy Storchaka.
| | | | | | | | | | * | | | | | | | | | | | (Merge 3.5) Issue #25182: Fix compilation on WindowsVictor Stinner2015-09-306-350/+513
| | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ Issue #25182: The stdprinter (used as sys.stderr before the io module isSerhiy Storchaka2015-09-301-4/+21
| | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imported at startup) now uses the backslashreplace error handler.
| | | | | | | | | | | * | | | | | | | | | | | | Optimize ascii/latin1+surrogateescape encodersVictor Stinner2015-09-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25227: Optimize ASCII and latin1 encoders with the ``surrogateescape`` error handler: the encoders are now up to 3 times as fast. Initial patch written by Serhiy Storchaka.
| | | | | | | | | | | * | | | | | | | | | | | | Issue #25227: Cleanup unicode_encode_ucs1() error handlerVictor Stinner2015-09-241-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change limit type from unsigned int to Py_UCS4, to use the same type than the "ch" variable (an Unicode character). * Reuse ch variable for _Py_ERROR_XMLCHARREFREPLACE * Add some newlines for readability
| | | | | | | | | | | * | | | | | | | | | | | | Issue #24870: revert unwanted changeVictor Stinner2015-09-221-43/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorry, I pushed the patch on the UTF-8 decoder by mistake :-(
| | | | | | | | | | | * | | | | | | | | | | | | Issue #25207, #14626: Fix my commit.Victor Stinner2015-09-221-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't work to use #define XXX defined(YYY)" and then "#ifdef XXX" to check YYY.
| | | | | | | | | | | * | | | | | | | | | | | | _PyUnicodeWriter_PrepareInternal(): make the assertion more strictVictor Stinner2015-09-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | * | | | | | | | | | | | | Issue #24870: Add _PyUnicodeWriter_PrepareKind() macroVictor Stinner2015-09-221-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a macro which ensures that the writer has at least the requested kind.
| | | | | | | | | | | * | | | | | | | | | | | | Issue #24870: Reuse the new _Py_error_handler enumVictor Stinner2015-09-221-87/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factorize code with the new get_error_handler() function. Add some empty lines for readability.
| | | | | | | | | | | * | | | | | | | | | | | | Issue #24870: Optimize the ASCII decoder for error handlers: surrogateescape,Victor Stinner2015-09-211-5/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ignore and replace. Initial patch written by Naoki Inada. The decoder is now up to 60 times as fast for these error handlers. Add also unit tests for the ASCII decoder.
| | | | | | | | | | | * | | | | | | | | | | | | Merge 3.5Victor Stinner2015-09-191-4/+6
| | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 3.5 (pytime, odict)Victor Stinner2015-09-186-271/+347
| | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | * | | | | | | | | | | | | | Issue #15989: Fixed some scarcely probable integer overflows.Serhiy Storchaka2015-09-061-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is very unlikely that they can occur in real code for now.
| | | | | | | | | | | | * | | | | | | | | | | | | | Issue #24912: Prevent __class__ assignment to immutable built-in objects. ↵Guido van Rossum2015-09-055-259/+335
| | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Merge 3.5 -> 3.6)
| | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge 3.5 (odict)Victor Stinner2015-09-035-259/+335
| | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | * | | | | | | | | | | | | | type_call() now detect bugs in type new and initVictor Stinner2015-09-031-19/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Call _Py_CheckFunctionResult() to check for bugs in type constructors (tp_new) * Add assertions to ensure an exception was raised if tp_init failed or that no exception was raised if tp_init succeed Refactor also the function to have less indentation.
| | | | | | | | | | | | | | * | | | | | | | | | | | | | Fixed an incorrect comment.Eric V. Smith2015-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | * | | | | | | | | | | | | | Merge #15944.Stefan Krah2015-08-083-239/+307
| | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge from 3.5 (issue #24667).Eric Snow2015-08-073-239/+307
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | Fix typo in comment.Eric V. Smith2015-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | Move the active entry multiplication to later in the hash calculationRaymond Hettinger2015-08-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | Restore frozenset hash caching removed in cf707dd190a9Raymond Hettinger2015-08-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | Closes #21279: Merge with 3.5Zachary Ware2015-08-061-5/+6
| | | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | Fix comment typoRaymond Hettinger2015-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | Tweak the commentsRaymond Hettinger2015-08-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | Issue #24762: Speed-up frozenset_hash() and greatly beef-up the comments.Raymond Hettinger2015-08-011-27/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | Issue #24681: Move the most likely test first in set_add_entry().Raymond Hettinger2015-07-311-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | Issue #24681: Move the store of so->table to the code block where it is used.Raymond Hettinger2015-07-231-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | Issue #23573: Restored optimization of bytes.rfind() and bytearray.rfind()Serhiy Storchaka2015-07-202-6/+14
| | | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for single-byte argument on Linux.
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | Issue #24583: Consolidate previous set object updates into a single functionRaymond Hettinger2015-07-201-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with a single entry point, named exit points at the bottom, more self-evident refcount adjustments, and a comment describing why the pre-increment was necessary at all.
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | Issue #24583: Fix refcount leak.Raymond Hettinger2015-07-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | Issue #24583: Fix crash when set is mutated while being updated.Raymond Hettinger2015-07-151-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | mergeRaymond Hettinger2015-07-152-210/+238
| | | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | | | * | | | | | | | | | | | | | | | Neaten-up a little bit.Raymond Hettinger2015-07-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |