| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* add a comment about why we need to increase trash_delete_nesting
* move increase and decrese outside of the loop
|
|
|
|
| |
PySet_GET_SIZE. (#751)
|
|
|
| |
We require C99, so a configure test for this standard feature is not needed.
|
| |
|
|
|
|
|
|
|
|
| |
Make a non-Py_DEBUG, asserts-enabled build of CPython possible. This means
making sure helper functions are defined when NDEBUG is not defined, not
just when Py_DEBUG is defined.
Also fix a division-by-zero in obmalloc.c that went unnoticed because in Py_DEBUG mode, elsize is never zero.
|
|
|
|
|
| |
deque (#887)
when pass indices of wrong type.
|
|
|
| |
if pass `accept={int, NoneType}`.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-6532: Make the thread id an unsigned integer.
From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".
* Restore a check in thread_get_ident().
|
| |
|
|
|
| |
Added the documentation for PyUnicode_Translate().
|
|
|
|
|
|
|
|
| |
* Add _PyObject_HasFastCall()
* partial_call() now avoids temporary tuple to pass positional
arguments if the callable supports the FASTCALL calling convention
for positional arguments.
* Fix also a performance regression in partial_call() if the callable
doesn't support FASTCALL.
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyEval_Call* APIs are not documented and they doesn't respect PY_SSIZE_T_CLEAN.
So add comment block which recommends PyObject_Call* APIs to ceval.h.
This commit also changes PyEval_CallMethod and PyEval_CallFunction
implementation same to PyObject_CallMethod and PyObject_CallFunction
to reduce future maintenance cost. Optimization to avoid temporary
tuple are copied too.
PyEval_CallFunction(callable, "i", (int)i) now calls callable(i) instead of
raising TypeError. But accepting this edge case is backward compatible.
|
|
|
| |
FreeBSD is the only platforms with unsigned FD_SETSIZE.
|
| |
|
|
|
|
| |
bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode
(st_ino) using unsigned integers.
|
| |
|
|
|
|
|
|
|
| |
sys.version and the platform module python_build(),
python_branch(), and python_revision() functions now use
git information rather than hg when building from a repo.
Based on original patches by Brett Cannon and Steve Dower.
|
|
|
| |
#ifdef HAVE_DECLSPEC_DLL / #endif mismatch
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-29463: Add docstring field to some AST nodes.
ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring
field for now. It was first statement of there body.
* fix document. thanks travis!
* doc fixes
|
|
|
|
|
|
|
|
|
| |
* Move all functions to call objects in a new Objects/call.c file.
* Rename fast_function() to _PyFunction_FastCallKeywords().
* Copy null_error() from Objects/abstract.c
* Inline type_error() in call.c to not have to copy it, it was only
called once.
* Export _PyEval_EvalCodeWithName() since it is now called
from call.c.
|
|
|
|
|
| |
Sorry, I didn't want to push this change before the review :-( I was pushing a
change into the 2.7 branch.
|
|
|
|
|
|
|
|
|
|
| |
* Move all functions to call objects in a new Objects/call.c file.
* Rename fast_function() to _PyFunction_FastCallKeywords().
* Copy null_error() from Objects/abstract.c
* Inline type_error() in call.c to not have to copy it, it was only
called once.
* Export _PyEval_EvalCodeWithName() since it is now called
from call.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #29507: Optimize slots calling Python methods. For Python methods, get
the unbound Python function and prepend arguments with self, rather than
calling the descriptor which creates a temporary PyMethodObject.
Add a new _PyObject_FastCall_Prepend() function used to call the unbound Python
method with self. It avoids the creation of a temporary tuple to pass
positional arguments.
Avoiding temporary PyMethodObject and avoiding temporary tuple makes Python
slots up to 1.46x faster. Microbenchmark on a __getitem__() method implemented
in Python:
Median +- std dev: 121 ns +- 5 ns -> 82.8 ns +- 1.0 ns: 1.46x faster (-31%)
Co-Authored-by: INADA Naoki <songofacandy@gmail.com>
|
|
|
|
| |
_PyArg_NoPositional() now are macros.
|
|\
| |
| |
| | |
using PySlice_GetIndicesEx() in debug builds.
|
| |\
| | |
| | |
| | | |
using PySlice_GetIndicesEx() in debug builds.
|
| | |
| | |
| | |
| | | |
using PySlice_GetIndicesEx() in debug builds.
|
| | |
| | |
| | |
| | | |
Calling builtin method is at most 10% faster.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | | |
a macro if Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher. Added functions
PySlice_Unpack() and PySlice_AdjustIndices().
|
| |\ \
| | |/
| | |
| | |
| | | |
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
|
| | |
| | |
| | |
| | |
| | | |
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | | |
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
Py_BuildValue() were not available in limited API of version < 3.3 when
PY_SSIZE_T_CLEAN is defined.
|
| |\ \
| | |/
| | |
| | |
| | |
| | |
| | | |
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
Py_BuildValue() were not available in limited API of version < 3.3 when
PY_SSIZE_T_CLEAN is defined.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
Py_BuildValue() were not available in limited API of version < 3.3 when
PY_SSIZE_T_CLEAN is defined.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It got messed up when I merged my private 3.5.3 release
changes with new work happening in the 3.5 main branch.
(3.5 main branch was in "3.5.3rc1", my branch was "3.5.3+",
and Mercurial helpfully merged the two in a kind of nonsense way.)
|
| | |\ |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Remove two assertions which can fail on legit code. Keyword arguments are
checked later with better tests and raise a regular (TypeError) exception.
|
| | | |
| | | |
| | | |
| | | | |
possible but Coccinelle couldn't find opportunity.
|
| | | |
| | | |
| | | |
| | | | |
is now of type "const char *" rather of "char *".
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #29259, #29263. methoddescr_call() creates a PyCFunction object, call it
and the destroy it. Add a new _PyMethodDef_RawFastCallDict() method to avoid
the temporary PyCFunction object.
|
| | | |
| | | |
| | | |
| | | | |
Issue #29259.
|
| | | |
| | | |
| | | |
| | | | |
Issue #29286.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #29286. Change _PyStack_UnpackDict() prototype to be able to notify of
failure when args is NULL.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #29286. Similar to _PyArg_NoKeywords(), but expects a tuple of keyword
names, instead of a dict.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Issue #29286. Function similar to PyArg_ParseTuple(), but uses a C array of
PyObject* to pass arguments. Don't support the compatibility mode.
|