| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(gh-95860)
We only statically initialize for core code and builtin modules. Extension modules still create
the tuple at runtime. We'll solve that part of interpreter isolation separately.
This change includes generated code. The non-generated changes are in:
* Tools/clinic/clinic.py
* Python/getargs.c
* Include/cpython/modsupport.h
* Makefile.pre.in (re-generate global strings after running clinic)
* very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c
All other changes are generated code (clinic, global strings).
|
|
|
|
| |
Replace "(PyCFunction)(void(*)(void))func" cast with
_PyCFunction_CAST(func).
|
|
|
|
|
| |
Argument Clinic now generates the same efficient code as before
adding the defining_class parameter.
|
|
|
|
|
|
|
| |
When compiled with `USE_ZLIB_CRC32` defined (`configure` sets this on POSIX systems), `binascii.crc32(...)` failed to compute the correct value when the input data was >= 4GiB. Because the zlib crc32 API is limited to a 32-bit length.
This lines it up with the `zlib.crc32(...)` implementation that doesn't have that flaw.
**Performance:** This also adopts the same GIL releasing for larger inputs logic that `zlib.crc32` has, and causes the Windows build to always use zlib's crc32 instead of our slow C code as zlib is a required build dependency on Windows.
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
| |
Port the zlib extension module to multi-phase initialization (PEP 489).
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-20443)
Previously, the result could have been an instance of a subclass of int.
Also revert bpo-26202 and make attributes start, stop and step of the range
object having exact type int.
Add private function _PyNumber_Index() which preserves the old behavior
of PyNumber_Index() for performance to use it in the conversion functions
like PyLong_AsLong().
|
|
|
|
| |
Only __index__ should be used to make integer conversions lossless.
|
|
|
|
| |
Argument Clinic. (GH-13593)
|
|
|
|
| |
(GH-12058)
|
|
|
|
| |
(GH-11313)
|
|
|
|
| |
parameter. (GH-9689)
|
|
|
|
|
|
|
|
| |
(GH-6748)
Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS in Argument Clinic generated code.
|
|
|
|
| |
(GH-7940)
|
|
|
|
| |
arguments. (#4746)
|
|
|
|
|
|
|
|
|
| |
When a single .c file contains several functions and/or methods with
the same name, a safety _METHODDEF #define statement is generated
only for one of them.
This fixes the bug by using the full name of the function to avoid
duplicates rather than just the name.
|
|
|
|
|
| |
the bare METH_FASTCALL be used for functions with positional-only
parameters.
|
|
|
|
|
|
|
|
| |
The function '_PyArg_ParseStack()' and
'_PyArg_UnpackStack' were failing (with error
"XXX() takes Y argument (Z given)") before
the function '_PyArg_NoStackKeywords()' was called.
Thus, the latter did not raise its more meaningful
error : "XXX() takes no keyword arguments".
|
|
|
|
|
| |
Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling
convention for functions using only positional arguments.
|
|
|
|
| |
Issue #29286.
|
| |
|
|
|
|
| |
Xiang Zhang.
|
|
|
|
| |
implemented with using Argument Clinic.
|
|\ |
|
| |
| |
| |
| | |
Patch by Xiang Zhang.
|
|\ \
| |/
| |
| | |
generated by Argument Clinic. Patch by Petr Viktorin.
|
| |
| |
| |
| | |
generated by Argument Clinic. Patch by Petr Viktorin.
|
| |
| |
| |
| | |
now. The first argument is positional-only.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Based on documentation by AM Kuchling.
|
| | |
|
|/ |
|
|
|
|
| |
Based on patch by Aviv Palivoda.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The underlying zlib library stores sizes in “unsigned int”. The corresponding
Python parameters are all sizes of buffers filled in by zlib, so it is okay
to reduce higher values to the UINT_MAX internal cap. OverflowError is still
raised for sizes that do not fit in Py_ssize_t.
Sizes are now limited to Py_ssize_t rather than unsigned long, because Python
byte strings cannot be larger than Py_ssize_t. Previously this could result
in a SystemError on 32-bit platforms.
This resolves a regression in the gzip module when reading more than UINT_MAX
or LONG_MAX bytes in one call, introduced by revision 62723172412c.
|
|
|
|
| |
same line as function name.
|
| |
|
|
|
|
| |
PyArg_Parse instead of PyArg_ParseTuple if possible.
|
|
|
|
|
|
| |
(empty) definition of the methoddef macro: it's only generated once, even
if Argument Clinic processes the same symbol multiple times, and it's emitted
at the end of all processing rather than immediately after the first use.
|
|
|
|
|
|
|
| |
The new syntax is highly human readable while still preventing false
positives. The syntax also extends Python syntax to denote "self" and
positional-only parameters, allowing inspect.Signature objects to be
totally accurate for all supported builtins in Python 3.4.
|
| |
|
|
|
|
|
| |
including correctly generating code for Clinic blocks inside C
preprocessor conditional blocks.
|
|
|
|
|
|
|
|
|
|
| |
annotate text signatures in docstrings, resulting in fewer false
positives. "self" parameters are also explicitly marked, allowing
inspect.Signature() to authoritatively detect (and skip) said parameters.
Issue #20326: Argument Clinic now generates separate checksums for the
input and output sections of the block, allowing external tools to verify
that the input has not changed (and thus the output is not out-of-date).
|
|
|