| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
The PyFPE_START_PROTECT() and PyFPE_END_PROTECT() macros are empty:
they have been doing nothing for the last year (since commit
735ae8d139a673b30b321dc10acfd3d14f0d633b), so stop using them.
|
| |
|
|
| |
Replace Py_FatalError() with a regular RuntimeError exception in
float.__getformat__().
|
| |
|
|
|
|
|
| |
(GH-13933)
In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values
(like in the optional third parameter of getattr). "None" should be used if None is accepted
as argument and passing None has the same effect as not passing the argument at all.
|
| |
|
|
|
|
|
|
| |
* bpo-38096: Clean up the "struct sequence" / "named tuple" docs
* Fix remaining occurrences of "struct sequence"
* Repair a user visible docstring
|
| |
|
|
|
| |
For example, rename PyTuple_Fini() to _PyTuple_Fini().
These functions are only declared in the internal C API.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
(GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
|
| | |
|
| |
|
|
| |
Classes that define __str__ the same as __repr__ can
just inherit it from object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Split _Py_InitializeCore_impl() into subfunctions: add multiple pycore_init_xxx() functions
* Preliminary sys.stderr is now set earlier to get an usable
sys.stderr ealier.
* Move code into _Py_Initialize_ReconfigureCore() to be able to call
it from _Py_InitializeCore().
* Split _PyExc_Init(): create a new _PyBuiltins_AddExceptions()
function.
* Call _PyExc_Init() earlier in _Py_InitializeCore_impl()
and new_interpreter() to get working exceptions earlier.
* _Py_ReadyTypes() now returns _PyInitError rather than calling
Py_FatalError().
* Misc code cleanup
|
| |
|
|
|
|
| |
PyObject_INIT() and PyObject_INIT_VAR() now cast their first argument
to PyObject*, as done in Python 3.7.
Revert partially commit b4435e20a92af474f117b78b98ddc6f515363af5.
|
| |
|
|
|
| |
* Convert PyObject_INIT() and PyObject_INIT_VAR() macros to static
inline functions.
* Fix usage of these functions: cast to PyObject* or PyVarObject*.
|
| | |
|
| |
|
|
|
| |
in int(), float() and complex() parsers.
This also speeds up parsing non-ASCII numbers by around 20%.
|
| |
|
|
|
| |
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.
|
| | |
|
| |\ |
|