| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
| |
Before, using the * operator to repeat a bytearray would copy data from the start of
the internal buffer (ob_bytes) and not from the start of the actual data (ob_start).
|
|
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Lawrence D’Anna <lawrence_danna@apple.com>
* Add support for macOS 11 and Apple Silicon (aka arm64)
As a side effect of this work use the system copy of libffi on macOS, and remove the vendored copy
* Support building on recent versions of macOS while deploying to older versions
This allows building installers on macOS 11 while still supporting macOS 10.9.
|
| |
|
| |
|
|
|
|
|
| |
Improve multi-threaded performance by dropping the GIL in the fast path
of bytes.join. To avoid increasing overhead for small joins, it is only
done if the output size exceeds a threshold.
|
| |
|
|
|
|
|
|
|
|
|
| |
In development mode and in debug build, encoding and errors arguments
are now checked on string encoding and decoding operations. Examples:
open(), str.encode() and bytes.decode().
By default, for best performances, the errors argument is only
checked at the first encoding/decoding error, and the encoding
argument is sometimes ignored for empty strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-22385: Support output separators in hex methods.
Also in binascii.hexlify aka b2a_hex.
The underlying implementation behind all hex generation in CPython uses the
same pystrhex.c implementation. This adds support to bytes, bytearray,
and memoryview objects.
The binascii module functions exist rather than being slated for deprecation
because they return bytes rather than requiring an intermediate step through a
str object.
This change was inspired by MicroPython which supports sep in its binascii
implementation (and does not yet support the .hex methods).
https://bugs.python.org/issue22385
|
|
|
|
|
|
|
| |
The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.
Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
|
| |
|
|
|
|
| |
Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat()
with empty result.
|
|
|
|
| |
(GH-9874)
|
|
|
| |
Constructing bytes from mutating list could cause a crash.
|
|
|
|
|
|
|
| |
(GH-9852)
bytes and bytearray constructors converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
|
|
|
|
| |
Covered all special cases: bytes, tuple, list, differend
kinds of iterables and iterators.
|
|
|
| |
separators that are not bytes-like objects.
|
| |
|
|
|
|
| |
bytes inside. (GH-499)
|
|\ |
|
| | |
|
|/
|
|
| |
whitespace, not only spaces. Patch by Robert Xiao.
|
|\
| |
| |
| | |
object.__format__ now contains the name of actual type.
|
| |
| |
| |
| | |
object.__format__ now contains the name of actual type.
|
| |
| |
| |
| |
| | |
Initially (e0b7e34b5971) it should be \udef0, but after 52a77ef069cd
(issue #3672) lone surrogates are not accepted and should be removed.
|
| |
| |
| |
| | |
Patch by Xiang Zhang.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Issue #25958: Support "anti-registration" of special methods from
various ABCs, like __hash__, __iter__ or __len__. All these (and
several more) can be set to None in an implementation class and the
behavior will be as if the method is not defined at all.
(Previously, this mechanism existed only for __hash__, to make
mutable classes unhashable.) Code contributed by Andrew Barnert and
Ivan Levkivskyi.
|
| |
| |
| |
| |
| | |
bytearray for integers in and out of the Py_ssize_t range.
Patch by Xiang Zhang.
|
|\ \
| |/
| |
| | |
negative integer for resized bytearray.
|
| |
| |
| |
| | |
negative integer for resized bytearray.
|
| |
| |
| |
| | |
now return an instance of corresponding subclass.
|
|\ \
| |/
| |
| | |
Based on patch by Joe Jevnik.
|
| |
| |
| |
| | |
Patch by Joe Jevnik.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Return a bytearray object when bytearray is requested and when the small buffer
is used.
Fix also test_bytes: bytearray%args must return a bytearray type.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
This eliminates a few redundant test cases.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ByteArrayAsStringTest.fixtype() was converting test data to bytes, not byte-
array, therefore many of the test cases inherited in this class were not
actually being run on the bytearray type.
The tests in buffer_tests.py were redundant with methods in string_tests
.MixinStrUnicodeUserStringTest and string_tests.CommonTest. These methods are
now moved into string_tests.BaseTest, where they will also get run for bytes
and bytearray.
This change also moves test_additional_split(), test_additional_rsplit(), and
test_strip() from CommonTest to BaseTest, meaning these tests are now run for
bytes and bytearray. I plan to eliminate redundancies with existing tests in
test_bytes.py soon.
|
|\ \
| |/
| |
| | |
sequences.
|
| |
| |
| |
| | |
sequences.
|
|\ \
| |/
| |
| |
| |
| | |
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
|
| |
| |
| |
| |
| |
| | |
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
|
|\ \
| |/ |
|