| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
return not int instance. Introduced _PyLong_FromNbInt() and refactored
PyLong_As*() functions.
|
| |
| |
| |
| |
| | |
return not int instance. Introduced _PyLong_FromNbInt() and refactored
PyLong_As*() functions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Reduce the base by the modulus when the base is larger than
the modulus. This can unboundedly speed the "startup costs"
of doing modular exponentiation, particularly in cases where
the base is much larger than the modulus. Original patch
by Armin Rigo, inspired by https://github.com/pyca/ed25519.
Merged from 3.3.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Reduce the base by the modulus when the base is larger than
the modulus. This can unboundedly speed the "startup costs"
of doing modular exponentiation, particularly in cases where
the base is much larger than the modulus. Original patch
by Armin Rigo, inspired by https://github.com/pyca/ed25519.
|
|\ \
| |/
| |
| | |
error messages and comments.
|
| |
| |
| |
| | |
error messages and comments.
|
| | |
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
- replace 'long int' / 'long' by 'int'
- fix capitalization of "Python" in PyLong_AsUnsignedLong
- "is too large" -> "too large", for consistency with other messages.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
small integers (0 or 1 digit)
|
| |
| |
| |
| | |
PyLong_FromLong() failure
|
| |
| |
| |
| | |
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
|
|\ \
| |/
| |
| |
| |
| |
| |
| | |
in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag), mpdecimal (needs to build without Python.h).
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag), mpdecimal (needs to build without Python.h).
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag).
|
| |\ \
| | |/
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| | |
| | |
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| | | |
|
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
objects as the base by using PyNumber_AsSsize_t similar to round().
|
| | |
| | |
| | |
| | | |
Consistent with the behavior in Python 2.
|
| | |
| | |
| | |
| | | |
PyLong_FromVoidPtr.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | | |
sizeof(long).
|
| | |
| | |
| | |
| | | |
endianess detection and handling.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | | |
Storchaka.
|
|/ / |
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Storchaka.
|
|\ \
| |/
| |
| | |
int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
|
| |
| |
| |
| | |
int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
created strings using _PyUnicode_CheckConsistency() in debug mode
|
|\ \
| |/ |
|