Antoine Pitrou
4de7457009
Issue #17173 : Remove uses of locale-dependent C functions (isalpha() etc.) 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).
14 years ago
Serhiy Storchaka
74f49ab28b
Issue #15989 : Fix several occurrences of integer overflow
when result of PyInt_AsLong() or PyLong_AsLong() narrowed
to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
14 years ago
Serhiy Storchaka
441d30fac7
Issue #15989 : Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
14 years ago
Serhiy Storchaka
0b386d5247
Issue #16761 : Raise TypeError when int() called with base argument only.
14 years ago
Serhiy Storchaka
cf095f8e0f
Issue #16761 : Raise TypeError when int() or long() called with base argument only.
14 years ago
Mark Dickinson
91044799f7
Issue #16277 : in PyLong_FromVoidPtr, add missing branch for sizeof(void*) <= sizeof(long).
14 years ago
Chris Jerdonek
ad4b000179
Issue #14783 : Backport changes from 3.2.
14 years ago
Chris Jerdonek
83fe2e1c22
Issue #14783 : Improve int() docstring and also str(), range(), and slice().
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.
14 years ago
Mark Dickinson
fc9adb62fb
Issue #16096 : Fix signed overflow in Objects/longobject.c. Thanks Serhiy Storchaka.
14 years ago
Mark Dickinson
c286e58044
Issue 15959: Fix type mismatch for quick{_neg}_int_allocs. Thanks Serhiy Storchaka.
14 years ago
Christian Heimes
79b97ee2ab
Fix out of bounds read in long_new() for empty bytes with an explicit base. int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
14 years ago
Christian Heimes
110ac16b9f
Fixed resource leak to scratch when _PyUnicodeWriter_Prepare fails
14 years ago
Victor Stinner
e577ab38ea
Issue #14744 : Fix compilation on Windows
14 years ago
Victor Stinner
d3f0882dfb
Issue #14744 : Use the new _PyUnicodeWriter internal API to speed up str%args 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.
14 years ago
Victor Stinner
3065093bb3
long_to_decimal_string() and _PyLong_Format() check the consistency of newly
created strings using _PyUnicode_CheckConsistency() in debug mode
14 years ago
Mark Dickinson
bcc17eefd2
Issue #14630 : Fix an incorrect access of ob_digit[0] for a zero instance of an int subclass.
14 years ago
Mark Dickinson
e28465482c
Issue #14339 : Improve speed of bin, oct and hex builtins. Patch by Serhiy Storchaka (with minor modifications).
14 years ago
Mark Dickinson
8d48b43ea9
Issue #12965 : Fix some inaccurate comments in Objects/longobject.c. Thanks Stefan Krah.
15 years ago
Victor Stinner
639418812f
Use the new Py_ARRAY_LENGTH macro
15 years ago
Martin v. Löwis
d63a3b8beb
Implement PEP 393.
15 years ago
Stefan Krah
b77c6c65c0
Issue #12963 : PyLong_AsSize_t() now returns (size_t)-1 in all error cases.
15 years ago
Nadeem Vawda
3d5881ec2b
Issue #12909 : Make PyLong_As* functions consistent in their use of exceptions.
PyLong_AsDouble() and PyLong_AsUnsignedLongLong() now raise TypeError (rather
than SystemError) when passed a non-integer argument, matching the behavior of
all the other PyLong_As*() functions.
15 years ago
Brian Curtin
dfc80e3d97
Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724 .
15 years ago
Ezio Melotti
c2077b0d9b
#11565 : Fix several typos. Patch by Piotr Kasprzyk.
15 years ago
Ezio Melotti
13925008dc
#11565 : Fix several typos. Patch by Piotr Kasprzyk.
15 years ago
Ezio Melotti
24b07bcba3
#11515 : fix several typos. Patch by Piotr Kasprzyk.
15 years ago
Ezio Melotti
42da663e6f
#11515 : fix several typos. Patch by Piotr Kasprzyk.
15 years ago
Mark Dickinson
c9fb3c6417
Fix indentation in Objects/longobject.c
16 years ago
Alexander Belopolsky
942af5a9a4
Issue #10557 : Fixed error messages from float() and other numeric
types. Added a new API function, PyUnicode_TransformDecimalToASCII(),
which transforms non-ASCII decimal digits in a Unicode string to their
ASCII equivalents.
16 years ago
Georg Brandl
71c23d4473
Include structseq.h in Python.h, and remove now-redundant includes in individual sources.
16 years ago
Benjamin Peterson
8035bc5c04
follow up to #9778 : define and use an unsigned hash type
16 years ago
Benjamin Peterson
8f67d0893f
make hashes always the size of pointers; introduce Py_hash_t #9778
16 years ago
Mark Dickinson
fa68a6188a
Fix naming inconsistency.
16 years ago
Mark Dickinson
f9a5a8e0af
Issue #2844 : Make int('42', n) consistently raise ValueError for
invalid integers n (including n = -909).
16 years ago
Mark Dickinson
7f1bf8004d
Issue #8817 : Expose round-to-nearest variant of divmod in _PyLong_Divmod_Near
for use by the datetime module; also refactor long_round to use this function.
16 years ago
Mark Dickinson
dc787d2055
Issue #8188 : Introduce a new scheme for computing hashes of numbers
(instances of int, float, complex, decimal.Decimal and
fractions.Fraction) that makes it easy to maintain the invariant that
hash(x) == hash(y) whenever x and y have equal value.
16 years ago
Mark Dickinson
cdd01d2ddb
Merged revisions 81037 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81037 | mark.dickinson | 2010-05-09 21:42:09 +0100 (Sun, 09 May 2010) | 1 line
Wrap multiline macros in a 'do {} while(0)', for safety.
........
16 years ago
Mark Dickinson
22b20183d5
Merged revisions 81036 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81036 | mark.dickinson | 2010-05-09 21:30:29 +0100 (Sun, 09 May 2010) | 1 line
Post-detabification cleanup: whitespace fixes and long line rewraps only.
........
16 years ago
Mark Dickinson
43ca377e45
Wrap multiline macros in a 'do {} while(0)', for safety.
16 years ago
Mark Dickinson
fda8d114ea
Post-detabification cleanup: whitespace fixes and long line rewraps only.
16 years ago
Antoine Pitrou
7f14f0d8a0
Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
................
16 years ago
Antoine Pitrou
f95a1b3c53
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
16 years ago
Antoine Pitrou
c7c96a90bc
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
16 years ago
Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
16 years ago
Mark Dickinson
e97ecba241
Merged revisions 80961 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80961 | mark.dickinson | 2010-05-08 09:01:19 +0100 (Sat, 08 May 2010) | 2 lines
Issue #8659 : Remove redundant ABS calls. Thanks Daniel Stutzbach.
........
16 years ago
Mark Dickinson
22ff664ff7
Issue #8659 : Remove redundant ABS calls. Thanks Daniel Stutzbach.
16 years ago
Stefan Krah
639e18410e
Issue #8328 : Silence Visual Studio warnings.
16 years ago
Stefan Krah
0091e5ecd0
Merged revisions 79885 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79885 | stefan.krah | 2010-04-07 10:24:44 +0200 (Wed, 07 Apr 2010) | 1 line
Issue #8328 : Silence Visual Studio warnings.
........
16 years ago
Stefan Krah
ef7590e943
Issue #8328 : Silence Visual Studio warnings.
16 years ago
Mark Dickinson
49a519c859
Merged revisions 79856 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79856 | mark.dickinson | 2010-04-06 19:58:54 +0100 (Tue, 06 Apr 2010) | 1 line
Silence a 'comparison between signed and unsigned integer expressions' gcc warning.
........
16 years ago