summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #14783: Merge changes from 3.3.Chris Jerdonek2012-10-074-10/+20
|\
| * Issue #14783: Merge changes from 3.2.Chris Jerdonek2012-10-074-10/+20
| |\
| | * Issue #14783: Improve int() docstring and also str(), range(), and slice().Chris Jerdonek2012-10-074-9/+19
| | | | | | | | | | | | | | | | | | 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.
* | | Issue #16148: Small improvements and cleanup. Added version informationArmin Ronacher2012-10-071-7/+8
| | | | | | | | | | | | to docs.
* | | Cleanup PyUnicode_FromFormatV() for zero paddingVictor Stinner2012-10-061-1/+5
| | | | | | | | | | | | | | | Skip the "0" instead of parsing it twice: detect zero padding and then parsed as a digit of the width.
* | | Issue #16147: PyUnicode_FromFormatV() doesn't need anymore to allocate a bufferVictor Stinner2012-10-061-46/+14
| | | | | | | | | | | | on the heap to format numbers.
* | | Issue #16147: PyUnicode_FromFormatV() now raises an error if the argument ofVictor Stinner2012-10-061-0/+5
| | | | | | | | | | | | '%c' is not in the range(0x110000).
* | | Issue #16147: PyUnicode_FromFormatV() now detects integer overflow when parsingVictor Stinner2012-10-061-1/+11
| | | | | | | | | | | | width and precision
* | | Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter APIVictor Stinner2012-10-061-483/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | Issue #16096: port fix from 3.3Mark Dickinson2012-10-061-3/+2
|\ \ \ | |/ /
| * | Issue #16096: Fix signed overflow in Objects/longobject.c. Thanks Serhiy ↵Mark Dickinson2012-10-061-3/+2
| | | | | | | | | | | | Storchaka.
* | | Issue #16096: Merge fixes from 3.3.Mark Dickinson2012-10-062-22/+13
|\ \ \ | |/ /
| * | Issue #16096: Fix several occurrences of potential signed integer overflow. ↵Mark Dickinson2012-10-062-22/+13
| | | | | | | | | | | | Thanks Serhiy Storchaka.
* | | and another oneChristian Heimes2012-10-061-2/+2
| | |
* | | move var declaration to top of block to fix compilation on Windows, fixes ↵Christian Heimes2012-10-061-2/+4
| | | | | | | | | | | | a7ec0a1b0f7c
* | | Fixed a missing incref introduced by a7ec0a1b0f7cArmin Ronacher2012-10-061-1/+1
| | |
* | | Added notimplemented_dealloc for better error reportingArmin Ronacher2012-10-061-1/+10
| | |
* | | Issue #16148: implemented PEP 424Armin Ronacher2012-10-065-35/+58
| | |
* | | In debug mode, unicode_write_cstr() now checks that non-ASCII characters areVictor Stinner2012-10-051-0/+8
| | | | | | | | | | | | not written into an ASCII string
* | | #16127: merge with 3.3.Ezio Melotti2012-10-051-10/+4
|\ \ \ | |/ /
| * | #16127: remove outdated references to narrow builds. Patch by Serhiy Storchaka.Ezio Melotti2012-10-051-10/+4
| | |
| * | Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failedVictor Stinner2012-10-041-1/+3
| | | | | | | | | | | | | | | This error cannot occur in practice: PyUnicode_FromObject() always return a "ready" string.
* | | Optimize unicode_compare(): use memcmp() when comparing two UCS1 stringsVictor Stinner2012-10-041-8/+25
| | |
* | | Enable also ptr==ptr optimization in PyUnicode_Compare()Victor Stinner2012-10-041-4/+5
| | | | | | | | | | | | It was already implemented in PyUnicode_RichCompare()
* | | long_to_decimal_string_internal() doesn't need to write the final NULL characterVictor Stinner2012-10-041-1/+0
| | |
* | | unicode_result_wchar(): move the assert() to the "#ifdef Py_DEBUG" blockVictor Stinner2012-10-041-3/+3
| | |
* | | Split the huge PyUnicode_Format() function (+540 lines) into subfunctionsVictor Stinner2012-10-041-472/+605
| | |
* | | PyUnicode_Format(): disable overallocation when we are writing the last partVictor Stinner2012-10-031-1/+3
| | | | | | | | | | | | of the output string
* | | Unicode: resize_compact() and resize_inplace() fills also the Unicode stringsVictor Stinner2012-10-031-5/+33
| | | | | | | | | | | | with invalid bytes in debug mode, as done by PyUnicode_New()
* | | Issue #15609: Fix refleak introduced by my last optimizationVictor Stinner2012-10-021-1/+4
| | |
* | | Issue #15609: Optimize str%args for integer argumentVictor Stinner2012-10-011-67/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use _PyLong_FormatWriter() instead of formatlong() when possible, to avoid a temporary buffer - Enable the fast path when width is smaller or equals to the length, and when the precision is bigger or equals to the length - Add unit tests! - formatlong() uses PyUnicode_Resize() instead of _PyUnicode_FromASCII() to resize the output string
* | | upgrade to UCD 6.2Benjamin Peterson2012-09-291-3/+10
|/ /
* | Fix typo.Ezio Melotti2012-09-281-2/+2
| |
* | Issue #16060: Fix a double DECREF in int() implementation. Thanks Serhiy ↵Mark Dickinson2012-09-271-4/+3
| | | | | | | | Storchaka.
* | Issue #15379: Fix passing of non-BMP characters as integers for the charmap ↵Antoine Pitrou2012-09-231-3/+4
|\ \ | |/ | | | | | | | | decoder (already working as unicode strings). Patch by Serhiy Storchaka.
| * Issue #15379: Fix passing of non-BMP characters as integers for the charmap ↵Antoine Pitrou2012-09-231-2/+26
| | | | | | | | | | | | decoder (already working as unicode strings). Patch by Serhiy Storchaka.
* | Issue 15959: Merge from 3.2.Mark Dickinson2012-09-201-1/+1
|\ \ | |/
| * Issue 15959: Fix type mismatch for quick{_neg}_int_allocs. Thanks Serhiy ↵Mark Dickinson2012-09-201-1/+1
| | | | | | | | Storchaka.
* | Issue #15144: Fix possible integer overflow when handling pointers as ↵Antoine Pitrou2012-09-205-32/+18
| | | | | | | | | | | | integer values, by using Py_uintptr_t instead of size_t. Patch by Serhiy Storchaka.
* | Silence compiler warnings on Solaris 10 via explicit (void *) casts.Trent Nelson2012-09-191-3/+3
|\ \ | |/
| * Silence compiler warnings on Solaris 10 via explicit (void *) casts.Trent Nelson2012-09-191-3/+3
| | | | | | | | (Compiler: Solaris Studio 12.3)
* | Fix out of bounds read in long_new() for empty bytes with an explicit base. ↵Christian Heimes2012-09-121-2/+2
|\ \ | |/ | | | | int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
| * Fix out of bounds read in long_new() for empty bytes with an explicit base. ↵Christian Heimes2012-09-121-2/+2
| | | | | | | | int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
* | Issue #15900: Fixed reference leak in PyUnicode_TranslateCharmap()Christian Heimes2012-09-111-6/+5
| |
* | Fixed memory leak in error branch of object_repr which may leak a reference ↵Christian Heimes2012-09-101-1/+3
|\ \ | |/ | | | | to mod when type_qualname returns NULL. CID 715371
| * Fixed memory leak in error branch of object_repr which may leak a reference ↵Christian Heimes2012-09-101-1/+3
| | | | | | | | to mod when type_name returns NULL. CID 715371
* | Fixed memory leak in error branch of formatfloat(). CID 719687Christian Heimes2012-09-101-1/+3
| |
* | Fixed possible reference leak to mod when type_name() returns NULLChristian Heimes2012-09-101-1/+3
|\ \ | |/
| * Fixed possible reference leak to mod when type_name() returns NULLChristian Heimes2012-09-101-1/+3
| |
* | PyTuple_Pack() was missing va_end() in its error branch which lead to a ↵Christian Heimes2012-09-101-1/+3
|\ \ | |/ | | | | resource leak.