| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
reliable.
|
| |
| |
| |
| | |
reliable.
|
|\ \
| |/
| |
| | |
_odict_add_new_node() fails.
|
| |
| |
| |
| | |
_odict_add_new_node() fails.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
is raised when it returns NULL.
Simplify also ceval.c: rely on the fact that PyObject_GetItem() raised an
exception when it returns NULL.
|
|\ \
| |/
| |
| | |
was mutated by direct calls of dict methods.
|
| |
| |
| |
| | |
was mutated by direct calls of dict methods.
|
|\ \
| |/
| |
| |
| |
| | |
KeyError in C implementations as well as in Python implementation.
Added tests for OrderedDict subclasses.
|
| |
| |
| |
| |
| |
| | |
KeyError in C implementations as well as in Python implementation.
Added tests for OrderedDict subclasses.
|
|\ \
| |/ |
|
| |\ |
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ /
| | |
| | | |
garbage collected.
|
| | |
| | |
| | |
| | | |
garbage collected.
|
|\ \ \
| |/ /
| | |
| | | |
self.__class__ in __repr__() and __reduce__() for simplicity and reliability.
|
| | |
| | |
| | |
| | | |
self.__class__ in __repr__() and __reduce__() for simplicity and reliability.
|
|\ \ \
| |/ /
| | |
| | | |
calculation fails.
|
| | |
| | |
| | |
| | | |
calculation fails.
|
|\ \ \
| |/ /
| | |
| | | |
OrderedDict.
|
| | |
| | |
| | |
| | | |
OrderedDict.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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'
|
|\ \ \
| |/ /
| | |
| | |
| | | |
that caused segmentation fault or hang in iterating after moving several
items to the start of ordered dict.
|
| | |
| | |
| | |
| | |
| | | |
that caused segmentation fault or hang in iterating after moving several
items to the start of ordered dict.
|
| | | |
|
| | |
| | |
| | |
| | | |
This function gives a control to the buffer size without using min_size.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|
| | | |
|
| | |
| | |
| | |
| | | |
enhance code to detect buffer under- and overflow.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | | |
Issue #25399: Add a new use_bytearray attribute to _PyBytesWriter to use a
bytearray buffer, instead of using a bytes object.
|
| | |
| | |
| | |
| | | |
Issue #25399: Fix long_format_binary(), allocate bytes for the bytes writer.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|
| | |
| | |
| | |
| | | |
the new _PyBytesWriter API.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Modify _PyBytesWriter_Finish() and _PyUnicodeWriter_Finish() to return the
empty bytes/Unicode string if the string is empty.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't require _PyBytesWriter pointer to be a "char *". Same change for
_PyBytesWriter_WriteBytes() parameter.
For example, binascii uses "unsigned char*".
|
| | |
| | |
| | |
| | | |
can now be pickled using pickle protocols older than protocol version 4.
|
| | |
| | |
| | |
| | | |
Optimize also %% formater.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
|