summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #25410: Made testing that od_fast_nodes and dk_entries are in sync moreSerhiy Storchaka2015-11-061-4/+8
|\ | | | | | | reliable.
| * Issue #25410: Made testing that od_fast_nodes and dk_entries are in sync moreSerhiy Storchaka2015-11-061-4/+8
| | | | | | | | reliable.
* | Issue #24726: Revert setting the value on the dict ifSerhiy Storchaka2015-11-061-1/+7
|\ \ | |/ | | | | _odict_add_new_node() fails.
| * Issue #24726: Revert setting the value on the dict ifSerhiy Storchaka2015-11-061-1/+7
| | | | | | | | _odict_add_new_node() fails.
* | Issue #25558: Refactoring OrderedDict iteration.Serhiy Storchaka2015-11-061-40/+31
|\ \ | |/
| * Issue #25558: Refactoring OrderedDict iteration.Serhiy Storchaka2015-11-061-40/+31
| |
* | Issue #25556: Add assertions to PyObject_GetItem() to ensure that an exceptionVictor Stinner2015-11-051-3/+8
| | | | | | | | | | | | | | is raised when it returns NULL. Simplify also ceval.c: rely on the fact that PyObject_GetItem() raised an exception when it returns NULL.
* | Issue #25449: Fixed a crash and leaking NULL in repr() of OrderedDict thatSerhiy Storchaka2015-11-041-2/+13
|\ \ | |/ | | | | was mutated by direct calls of dict methods.
| * Issue #25449: Fixed a crash and leaking NULL in repr() of OrderedDict thatSerhiy Storchaka2015-11-041-2/+13
| | | | | | | | was mutated by direct calls of dict methods.
* | Issue #25449: Iterating OrderedDict with keys with unstable hash now raisesSerhiy Storchaka2015-11-041-0/+2
|\ \ | |/ | | | | | | | | KeyError in C implementations as well as in Python implementation. Added tests for OrderedDict subclasses.
| * Issue #25449: Iterating OrderedDict with keys with unstable hash now raisesSerhiy Storchaka2015-11-041-0/+2
| | | | | | | | | | | | KeyError in C implementations as well as in Python implementation. Added tests for OrderedDict subclasses.
* | Issue #25523: Merge a-to-an corrections from 3.5.Serhiy Storchaka2015-11-021-2/+2
|\ \ | |/
| * Issue #25523: Merge a-to-an corrections from 3.4.Serhiy Storchaka2015-11-021-2/+2
| |\
| | * Issue #25523: Further a-to-an corrections.Serhiy Storchaka2015-11-021-2/+2
| | |
* | | Issue #25523: Merge a-to-an corrections from 3.5Martin Panter2015-11-022-2/+2
|\ \ \ | |/ /
| * | Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-022-2/+2
| |\ \ | | |/
| | * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-022-2/+2
| | | | | | | | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | | Issue #25395: Fixed crash when highly nested OrderedDict structures wereSerhiy Storchaka2015-11-011-3/+14
|\ \ \ | |/ / | | | | | | garbage collected.
| * | Issue #25395: Fixed crash when highly nested OrderedDict structures wereSerhiy Storchaka2015-11-011-3/+14
| | | | | | | | | | | | garbage collected.
* | | Issue #25410: C implementation of OrderedDict now uses type(self) instead ofSerhiy Storchaka2015-10-221-31/+14
|\ \ \ | |/ / | | | | | | self.__class__ in __repr__() and __reduce__() for simplicity and reliability.
| * | Issue #25410: C implementation of OrderedDict now uses type(self) instead ofSerhiy Storchaka2015-10-221-31/+14
| | | | | | | | | | | | self.__class__ in __repr__() and __reduce__() for simplicity and reliability.
* | | Issue #25410: Fixed a memory leak in OrderedDict in the case when key's hashSerhiy Storchaka2015-10-201-1/+1
|\ \ \ | |/ / | | | | | | calculation fails.
| * | Issue #25410: Fixed a memory leak in OrderedDict in the case when key's hashSerhiy Storchaka2015-10-201-1/+1
| | | | | | | | | | | | calculation fails.
* | | Issue #25410: Cleaned up and fixed minor bugs in C implementation of ↵Serhiy Storchaka2015-10-181-158/+72
|\ \ \ | |/ / | | | | | | OrderedDict.
| * | Issue #25410: Cleaned up and fixed minor bugs in C implementation of ↵Serhiy Storchaka2015-10-181-158/+72
| | | | | | | | | | | | OrderedDict.
* | | Issue #25210: Change error message of do_richcompare()Victor Stinner2015-10-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't add parenthesis to type names. Add also quotes around the type names. Before: TypeError: unorderable types: int() < NoneType() After: TypeError: '<' not supported between instances of 'int' and 'NoneType'
* | | Issue #25406: Fixed a bug in C implementation of OrderedDict.move_to_end()Serhiy Storchaka2015-10-141-21/+10
|\ \ \ | |/ / | | | | | | | | | that caused segmentation fault or hang in iterating after moving several items to the start of ordered dict.
| * | Issue #25406: Fixed a bug in C implementation of OrderedDict.move_to_end()Serhiy Storchaka2015-10-141-21/+10
| | | | | | | | | | | | | | | that caused segmentation fault or hang in iterating after moving several items to the start of ordered dict.
* | | Use _PyBytesWriter in _PyBytes_FromIterator()Victor Stinner2015-10-141-19/+18
| | |
* | | Add _PyBytesWriter_Resize() functionVictor Stinner2015-10-141-18/+30
| | | | | | | | | | | | This function gives a control to the buffer size without using min_size.
* | | Factorize _PyBytes_FromList() and _PyBytes_FromTuple() code using a C macroVictor Stinner2015-10-141-54/+35
| | |
* | | Split PyBytes_FromObject() into subfunctionsVictor Stinner2015-10-141-71/+114
| | |
* | | Modify _PyBytes_DecodeEscapeRecode() to use _PyBytesAPIVictor Stinner2015-10-141-58/+73
| | | | | | | | | | | | | | | | | | | | | * Don't overallocate by 400% when recode is needed: only overallocate on demand using _PyBytesWriter. * Use _PyLong_DigitValue to convert hexadecimal digit to int * Create _PyBytes_DecodeEscapeRecode() subfunction
* | | Fix compiler warnings (uninitialized variables), false alarms in factVictor Stinner2015-10-141-4/+2
| | |
* | | _PyBytesWriter_Alloc(): only use 10 bytes of the small buffer in debug mode toVictor Stinner2015-10-141-1/+13
| | | | | | | | | | | | enhance code to detect buffer under- and overflow.
* | | Issue #25401: Remove now unused hex_digit_to_int() functionVictor Stinner2015-10-141-16/+0
| | |
* | | Optimize bytes.fromhex() and bytearray.fromhex()Victor Stinner2015-10-142-94/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now between 2x and 3.5x faster. Changes: * Use a fast-path working on a char* string for ASCII string * Use a slow-path for non-ASCII string * Replace slow hex_digit_to_int() function with a O(1) lookup in _PyLong_DigitValue precomputed table * Use _PyBytesWriter API to handle the buffer * Add unit tests to check the error position in error messages
* | | Optimize bytearray % argsVictor Stinner2015-10-142-35/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25399: Don't create temporary bytes objects: modify _PyBytes_Format() to create work directly on bytearray objects. * Rename _PyBytes_Format() to _PyBytes_FormatEx() just in case if something outside CPython uses it * _PyBytes_FormatEx() now uses (char*, Py_ssize_t) for the input string, so bytearray_format() doesn't need tot create a temporary input bytes object * Add use_bytearray parameter to _PyBytes_FormatEx() which is passed to _PyBytesWriter, to create a bytearray buffer instead of a bytes buffer Most formatting operations are now between 2.5 and 5 times faster.
* | | Add use_bytearray attribute to _PyBytesWriterVictor Stinner2015-10-141-28/+65
| | | | | | | | | | | | | | | Issue #25399: Add a new use_bytearray attribute to _PyBytesWriter to use a bytearray buffer, instead of using a bytes object.
* | | Fix long_format_binary()Victor Stinner2015-10-141-1/+1
| | | | | | | | | | | | Issue #25399: Fix long_format_binary(), allocate bytes for the bytes writer.
* | | Rewrite PyBytes_FromFormatV() using _PyBytesWriter APIVictor Stinner2015-10-131-171/+165
| | | | | | | | | | | | | | | | | | | | | * Add much more unit tests on PyBytes_FromFormatV() * Remove the first loop to compute the length of the output string * Use _PyBytesWriter to handle the bytes buffer, use overallocation * Cleanup the code to make simpler and easier to review
* | | Issue #25353: Optimize unicode escape and raw unicode escape encoders to useVictor Stinner2015-10-121-44/+69
| | | | | | | | | | | | the new _PyBytesWriter API.
* | | Fix compilation error in _PyBytesWriter_WriteBytes() on WindowsVictor Stinner2015-10-121-1/+3
| | |
* | | Writer APIs: use empty string singletonsVictor Stinner2015-10-122-18/+32
| | | | | | | | | | | | | | | Modify _PyBytesWriter_Finish() and _PyUnicodeWriter_Finish() to return the empty bytes/Unicode string if the string is empty.
* | | Relax _PyBytesWriter APIVictor Stinner2015-10-121-8/+7
| | | | | | | | | | | | | | | | | | | | | Don't require _PyBytesWriter pointer to be a "char *". Same change for _PyBytesWriter_WriteBytes() parameter. For example, binascii uses "unsigned char*".
* | | Issue #24164: Objects that need calling ``__new__`` with keyword arguments,Serhiy Storchaka2015-10-101-13/+3
| | | | | | | | | | | | can now be pickled using pickle protocols older than protocol version 4.
* | | Issue #25349: Add fast path for b'%c' % intVictor Stinner2015-10-091-10/+15
| | | | | | | | | | | | Optimize also %% formater.
* | | Issue #25349: Optimize bytes % intVictor Stinner2015-10-092-27/+129
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Optimize error handlers of ASCII and Latin1 encoders when the replacementVictor Stinner2015-10-092-43/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | string is pure ASCII: use _PyBytesWriter_WriteBytes(), don't check individual character. Cleanup unicode_encode_ucs1(): * Rename repunicode to rep * Clear rep object on error * Factorize code between bytes and unicode path
* | | Add _PyBytesWriter_WriteBytes() to factorize the codeVictor Stinner2015-10-093-16/+28
| | |