| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c
parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be
rounded into finite floats. Tests were added to very this behavior.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Based on patch by Vajrasky Kok.
|
|
|
|
| |
and tuple(). (#518)
|
|
|
|
| |
int(), bool(), float(), list() and tuple(). Specify the value as a
positional argument instead.
|
|
|
|
|
|
| |
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func)
* PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg)
PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires
extra work to "parse" C arguments to build a C array of PyObject*.
_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
This change is part of the fastcall project. The change on listsort() is
related to the issue #23507.
|
|
|
|
| |
UTF-8 represenatation of Unicode objects.
|
|
|
|
| |
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
|
|
|
|
| |
Thanks to Georg Brandl for the patch.
|
|
|
|
| |
module. Original patch by Eli Stevens.
|
|
|
|
|
|
| |
The deprecation warning is emitted if __float__ returns an instance of
a strict subclass of float. In a future versions of Python this can
be an error.
|
| |
|
| |
|
|\ |
|
|\ \
| |/ |
|
| | |
|
|/
|
|
|
|
| |
Decimals by 3 times.
Unified error messages in float.as_integer_ratio(), Decimal.as_integer_ratio(),
and Fraction constructors.
|
|\
| |
| |
| |
| | |
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
|
| |
| |
| |
| |
| | |
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This avoids possible buffer overreads when int(), float(), compile(), exec()
and eval() are passed bytes-like objects. Similar code is removed from the
complex() constructor, where it was not reachable.
Patch by John Leitch, Serhiy Storchaka and Martin Panter.
|
| |
| |
| |
| | |
Vajrasky Kok.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| | |
and PyObject_AsWriteBuffer().
|
| |
| |
| |
| | |
and PyObject_AsWriteBuffer().
|
|/
|
|
| |
Corresponding functions now accept `const char *` (issue #1772673).
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PyObject_INIT() macros returns obj:
../cpython/Objects/methodobject.c:32:23: warning: expression result unused [-Wunused-value]
PyObject_INIT(op, &PyCFunction_Type);
^~
../cpython/Include/objimpl.h:139:69: note: expanded from macro 'PyObject_INIT'
( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
^
1 warning generated.
|
|
|
|
|
|
|
|
| |
written in C.
As a part of this, a few doctests have been added to the builtins module
(on hex(), oct(), and bin()), a doctest has been fixed (hopefully on all
platforms) on float, and test_builtins now runs doctests in builtins.
|
| |
|
|\ |
|
| | |
|
|\ \
| |/
| |
| | |
error messages and comments.
|
| |
| |
| |
| | |
error messages and comments.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
PyStructSequence_InitType() except that it has a return value (0 on success,
-1 on error).
* PyStructSequence_InitType2() now raises MemoryError on memory allocation failure
* Fix also some calls to PyDict_SetItemString(): handle error
|
| |
| |
| |
| | |
multiprocessing.h: remove unused MIN and MAX macros
|
|/
|
|
|
|
|
|
|
|
|
|
| |
* Add also min_char attribute to _PyUnicodeWriter structure (currently unused)
* _PyUnicodeWriter_Init() has no more argument (except the writer itself):
min_length and overallocate must be set explicitly
* In error handlers, only enable overallocation if the replacement string
is longer than 1 character
* CJK decoders don't use overallocation anymore
* Set min_length, instead of preallocating memory using
_PyUnicodeWriter_Prepare(), in many decoders
* _PyUnicode_DecodeUnicodeInternal() checks for integer overflow
|
| |
|
|
|
|
| |
allocation issues
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and str.format(args)
* Formatting string, int, float and complex use the _PyUnicodeWriter API. It
avoids a temporary buffer in most cases.
* Add _PyUnicodeWriter_WriteStr() to restore the PyAccu optimization: just
keep a reference to the string if the output is only composed of one string
* Disable overallocation when formatting the last argument of str%args and
str.format(args)
* Overallocation allocates at least 100 characters: add min_length attribute
to the _PyUnicodeWriter structure
* Add new private functions: _PyUnicode_FastCopyCharacters(),
_PyUnicode_FastFill() and _PyUnicode_FromASCII()
The speed up is around 20% in average.
|
|
|
|
|
|
| |
PyFloatObjects are now allocated using PyObject_MALLOC like all other
internal types, but maintain a limited freelist of objects at hand for
performance. This will result in more consistent memory usage by Python.
|
|\ |
|
| |
| |
| |
| | |
dtoa.c functions in float round.
|
| | |
|
| | |
|