Victor Stinner
0d92c4f667
Issue #16416 : Fix error handling in _Py_wchar2char() _Py_char2wchar() functions
13 years ago
Antoine Pitrou
e11fecb5a9
Issue #16453 : Fix equality testing of dead weakref objects.
Also add tests for ordering and hashing.
13 years ago
Mark Dickinson
c8a6967ea8
Issue #14794 : slice.indices no longer returns OverflowError for out-of-range start, stop, step or length.
13 years ago
Victor Stinner
fc009eff9e
Close #16311 : Use the _PyUnicodeWriter API in text decoders
* Remove unicode_widen(): replaced with _PyUnicodeWriter_Prepare()
* Remove unicode_putchar(): replaced with
PyUnicodeWriter_Prepare() + PyUnicode_WRITER()
* When handling an decoding error, only overallocate the buffer by +25%
instead of +100%
13 years ago
Victor Stinner
ab60de478d
Issue #8271 : Fix compilation on Windows
13 years ago
Ezio Melotti
f7ed5d111b
#8271 : the utf-8 decoder now outputs the correct number of U+FFFD characters when used with the "replace" error handler on invalid utf-8 sequences. Patch by Serhiy Storchaka, tests by Ezio Melotti.
13 years ago
Mark Dickinson
8cd1c7681d
Issue #16402 : In range slicing, fix shadowing of exceptions from __index__ method.
13 years ago
Christian Heimes
6d26ade920
Fix compilation on Windows
13 years ago
Ezio Melotti
c64bcbec4b
#8401 : assigning an int to a bytearray slice (e.g. b[3:4] = 5) now raises an error.
13 years ago
Stefan Krah
4af77a0276
Issue #15814 : Use hash function that is compatible with the equality
definition from #15573 .
13 years ago
Benjamin Peterson
9892f52145
avoid a function call with redundant checks for dict size
13 years ago
Benjamin Peterson
d1f2cb37a2
only fast-path fromkeys() when the constructor returns a empty dict ( closes #16345 )
13 years ago
Benjamin Peterson
2c05a2e01b
do safety checks on __qualname__ assignment
13 years ago
Benjamin Peterson
8afa7fa510
don't shadow the __qualname__ descriptor with __qualname__ in the class's __dict__ ( closes #16271 )
13 years ago
Benjamin Peterson
42124a727d
initialize map/filter/zip in _PyBuiltin_Init rather than the catch-all function
13 years ago
Benjamin Peterson
c43112823b
initialize more global type objects ( closes #16369 )
13 years ago
Victor Stinner
7a6d7cf3db
Issue #9566 : Use the right type to fix a compiler warnings on Win64
13 years ago
Victor Stinner
4ca1cf35fb
Issue #16086 : PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned
... (unsigned long and unsigned int) to avoid an undefined behaviour with
Py_TPFLAGS_TYPE_SUBCLASS ((1 << 31). PyType_GetFlags() result type is now
unsigned too (unsigned long, instead of long).
13 years ago
Victor Stinner
e64322e034
Close #14625 : Rewrite the UTF-32 decoder. It is now 3x to 4x faster
Patch written by Serhiy Storchaka.
13 years ago
Victor Stinner
76df43de30
Issue #16330 : Use surrogate-related macros
Patch written by Serhiy Storchaka.
13 years ago
Mark Dickinson
fb90c0934c
Issue #14700 : Fix buggy overflow checks for large precision and width in new-style and old-style formatting.
13 years ago
Victor Stinner
c6cf1ba29e
Replace usage of the deprecated Py_UNICODE_COPY() with Py_MEMCPY() in resize_copy()
13 years ago
Victor Stinner
fe75fb4b3e
Optimize _PyUnicode_HasNULChars(): use findchar() instead of PyUnicode_Contains()
13 years ago
Victor Stinner
6fa627578a
Inline raise_translate_exception(): it is only used once
13 years ago
Victor Stinner
e5567ad236
Optimize PyUnicode_RichCompare() for Py_EQ and Py_NE: always use memcmp()
13 years ago
Antoine Pitrou
6f7b0da6bc
Issue #12805 : Make bytes.join and bytearray.join faster when the separator is empty.
Patch by Serhiy Storchaka.
13 years ago
Mark Dickinson
e453e4c007
Issue 16280: Drop questionable special-casing of null pointer in PyLong_FromVoidPtr.
13 years ago
Mark Dickinson
91044799f7
Issue #16277 : in PyLong_FromVoidPtr, add missing branch for sizeof(void*) <= sizeof(long).
13 years ago
Christian Heimes
743e0cd6b5
Issue #16166 : Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
endianess detection and handling.
13 years ago
Eric Snow
547298c94c
Close #16160 : Subclass support now works for types.SimpleNamespace. Thanks to RDM for noticing.
13 years ago
Antoine Pitrou
cfc22b4a9b
Issue #15958 : bytes.join and bytearray.join now accept arbitrary buffer objects.
13 years ago
Chris Jerdonek
83fe2e1c22
Issue #14783 : Improve int() docstring and also str(), range(), and slice().
This commit rewrites the docstring for int() to incorporate the documentation
changes made in issue #16036 . It also switches the docstrings for int(),
str(), range(), and slice() to use multi-line signatures.
14 years ago
Armin Ronacher
74b38b190f
Issue #16148 : Small improvements and cleanup. Added version information
to docs.
14 years ago
Victor Stinner
4c63a972d1
Cleanup PyUnicode_FromFormatV() for zero padding
Skip the "0" instead of parsing it twice: detect zero padding and then parsed
as a digit of the width.
14 years ago
Victor Stinner
15a1136547
Issue #16147 : PyUnicode_FromFormatV() doesn't need anymore to allocate a buffer
on the heap to format numbers.
14 years ago
Victor Stinner
ff5a848db5
Issue #16147 : PyUnicode_FromFormatV() now raises an error if the argument of
'%c' is not in the range(0x110000).
14 years ago
Victor Stinner
3921e90c5a
Issue #16147 : PyUnicode_FromFormatV() now detects integer overflow when parsing
width and precision
14 years ago
Victor Stinner
e215d960be
Issue #16147 : Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter API
* Simplify the code: replace 4 steps with one unique step using the
_PyUnicodeWriter API. PyUnicode_Format() has the same design. It avoids to
store intermediate results which require to allocate an array of pointers on
the heap.
* Use the _PyUnicodeWriter API for speed (and its convinient API):
overallocate the buffer to reduce the number of "realloc()"
* Implement "width" and "precision" in Python, don't rely on sprintf(). It
avoids to need of a temporary buffer allocated on the heap: only use a small
buffer allocated in the stack.
* Add _PyUnicodeWriter_WriteCstr() function
* Split PyUnicode_FromFormatV() into two functions: add
unicode_fromformat_arg().
* Inline parse_format_flags(): the format of an argument is now only parsed
once, it's no more needed to have a subfunction.
* Optimize PyUnicode_FromFormatV() for characters between two "%" arguments:
search the next "%" and copy the substring in one chunk, instead of copying
character per character.
14 years ago
Mark Dickinson
fc9adb62fb
Issue #16096 : Fix signed overflow in Objects/longobject.c. Thanks Serhiy Storchaka.
14 years ago
Mark Dickinson
c04ddff290
Issue #16096 : Fix several occurrences of potential signed integer overflow. Thanks Serhiy Storchaka.
14 years ago
Christian Heimes
b70e8a1958
and another one
14 years ago
Christian Heimes
6314d164c9
move var declaration to top of block to fix compilation on Windows, fixes a7ec0a1b0f7c
14 years ago
Armin Ronacher
23c5bb4030
Fixed a missing incref introduced by a7ec0a1b0f7c
14 years ago
Armin Ronacher
226b1db0e2
Added notimplemented_dealloc for better error reporting
14 years ago
Armin Ronacher
aa9a79d279
Issue #16148 : implemented PEP 424
14 years ago
Victor Stinner
8c6db45d3e
In debug mode, unicode_write_cstr() now checks that non-ASCII characters are
not written into an ASCII string
14 years ago
Ezio Melotti
e7f90375b1
#16127 : remove outdated references to narrow builds. Patch by Serhiy Storchaka.
14 years ago
Victor Stinner
1929407406
Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failed
This error cannot occur in practice: PyUnicode_FromObject() always return
a "ready" string.
14 years ago
Victor Stinner
770e19e0cc
Optimize unicode_compare(): use memcmp() when comparing two UCS1 strings
14 years ago
Victor Stinner
90db9c47dc
Enable also ptr==ptr optimization in PyUnicode_Compare()
It was already implemented in PyUnicode_RichCompare()
14 years ago