Mark Dickinson
4ca7c3c089
Issue #8748 : Fix incorrect results from comparisons between an integer
and a complex instance. Based on a patch by Meador Inge.
16 years ago
Mark Dickinson
4b3035d0b8
Remove declaration for unused variable.
16 years ago
Mark Dickinson
813363743d
Issue #5211 : Complete removal of implicit coercions for the complex
type. Coercion for arithmetic operations was already removed in
r78280, but that commit didn't remove coercion for rich comparisons.
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
cc6a982de8
Issue #8748 : Fix two issues with comparisons between complex and integer
objects. (1) The comparison could incorrectly return True in some cases
(2**53+1 == complex(2**53) == 2**53), breaking transivity of equality.
(2) The comparison raised an OverflowError for large integers, leading
to unpredictable exceptions when combining integers and complex objects
in sets or dicts.
Patch by Meador Inge.
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
f673f0c40c
Issue #7845 : Make 1j.__le__(2j) return NotImplemented rather than raising TypeError.
16 years ago
Ezio Melotti
50363262b2
Merged revisions 78319 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78319 | ezio.melotti | 2010-02-22 18:30:58 +0200 (Mon, 22 Feb 2010) | 1 line
#7482 : clarify error message in case of division by zero of float and complex numbers.
........
17 years ago
Ezio Melotti
bce3e17bd2
#7482 : clarify error message in case of division by zero of float and complex numbers.
17 years ago
Mark Dickinson
82b34c5dbe
Issue #5211 : Fix complex type to avoid implicit calls to
complex.__coerce__. Thanks Meador Inge for the patch.
17 years ago
Benjamin Peterson
aea4428fdc
Merged revisions 77292-77293 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77292 | benjamin.peterson | 2010-01-03 18:43:01 -0600 (Sun, 03 Jan 2010) | 1 line
do correct lookup of the __complex__ method
........
r77293 | benjamin.peterson | 2010-01-03 19:00:47 -0600 (Sun, 03 Jan 2010) | 1 line
factor out __complex__ lookup code to fix another case
........
17 years ago
Benjamin Peterson
3694366af5
factor out __complex__ lookup code to fix another case
17 years ago
Benjamin Peterson
ecdae19fbe
do correct lookup of the __complex__ method
17 years ago
Mark Dickinson
a4962cb694
Merged revisions 76561 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76561 | mark.dickinson | 2009-11-28 12:30:36 +0000 (Sat, 28 Nov 2009) | 5 lines
Include ieeefp.h (when available) in pyport.h instead of individually in
Objects/floatobject.c and Objects/complexobject.c. This should silence
compiler warnings about implicit declaration of the 'finite' function
on Solaris.
........
17 years ago
Mark Dickinson
31f0cfef0e
Include ieeefp.h (when available) in pyport.h instead of individually in
Objects/floatobject.c and Objects/complexobject.c. This should silence
compiler warnings about implicit declaration of the 'finite' function
on Solaris.
17 years ago
Mark Dickinson
c04c7c5b72
Issue #7117 : Use PyOS_string_to_double instead of PyOS_ascii_strtod in
complexobject.c. Also remove length restriction on unicode inputs to
the complex constructor.
17 years ago
Mark Dickinson
1daebdf82c
Make sure memory is freed on error in complex_subtype_from_string.
17 years ago
Mark Dickinson
f972488213
Remove length limitation on string arguments to complex()
17 years ago
Skip Montanaro
ba1e0f46ab
Issue 7147 - remove ability to attempt to build Python without complex number support (was broken anyway)
17 years ago
Mark Dickinson
a4e0efa4b1
Issue #5829 : don't raise OverflowError for complex('1e500'). Backport of r72803.
17 years ago
Mark Dickinson
6b1e43b7bc
Issue #5829 : complex('1e500') shouldn't raise OverflowError
17 years ago
Mark Dickinson
df99f04895
Merged revisions 72718 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72718 | mark.dickinson | 2009-05-17 11:38:30 +0100 (Sun, 17 May 2009) | 4 lines
Issue #6044 : remove confusing wording from complex -> integer and
complex -> float conversion error messages.
........
17 years ago
Mark Dickinson
578cc749ab
Merged revisions 72718 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72718 | mark.dickinson | 2009-05-17 11:38:30 +0100 (Sun, 17 May 2009) | 4 lines
Issue #6044 : remove confusing wording from complex -> integer and
complex -> float conversion error messages.
........
17 years ago
Mark Dickinson
50626db437
Issue #6044 : remove confusing wording from complex -> integer and
complex -> float conversion error messages.
17 years ago
Eric Smith
a985a3aee4
Issue #5920 : Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
17 years ago
Eric Smith
63376228a3
Issue #5920 : Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
17 years ago
Mark Dickinson
aa77d26009
Merged revisions 72253 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72253 | mark.dickinson | 2009-05-03 21:59:48 +0100 (Sun, 03 May 2009) | 2 lines
Eliminate some locale-dependent calls to isspace and tolower.
........
17 years ago
Mark Dickinson
777e4ff503
Eliminate some locale-dependent calls to isspace and tolower.
17 years ago
Mark Dickinson
725bfd8489
Issue #5914 : Add new C-API function PyOS_string_to_double, to complement
PyOS_double_to_string, and deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
17 years ago
Eric Smith
58a42244cf
Issue #1588 : Add complex.__format__.
17 years ago
Eric Smith
9139cc6a3b
Issue #1588 : Add complex.__format__.
17 years ago
Mark Dickinson
35f1c9470a
Merged revisions 71963 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71963 | mark.dickinson | 2009-04-26 15:00:08 +0100 (Sun, 26 Apr 2009) | 2 lines
Reset errno before both calls to PyOS_ascii_strtod, not just one.
........
17 years ago
Mark Dickinson
944c6aedd0
Reset errno before both calls to PyOS_ascii_strtod, not just one.
17 years ago
Mark Dickinson
22999a69e1
Issue #5829 : complex('1e-500') shouldn't raise an exception.
Also fix some confusing indentation.
17 years ago
Mark Dickinson
de8a710849
Merged revisions 71869 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71869 | mark.dickinson | 2009-04-25 10:47:00 +0100 (Sat, 25 Apr 2009) | 2 lines
Fix typo in complex parsing code; expand tests.
........
17 years ago
Mark Dickinson
0a6501bf56
Fix typo in complex parsing code; expand tests.
17 years ago
Mark Dickinson
6649fa42f8
Make sure that complex parsing code and corresponding tests
match for 2.7 and 3.1, and that 3.1 continues to
accept complex('j') and complex('4-j')
17 years ago
Mark Dickinson
90d47cb46c
Fix missing 'return NULL'
17 years ago
Mark Dickinson
95bc980d9e
Issue #5816 :
- simplify parsing and printing of complex numbers
- make complex(repr(z)) round-tripping work for complex
numbers involving nans, infs, or negative zeros
- don't accept some of the stranger complex strings
that were previously allowed---e.g., complex('1..1j')
17 years ago
Mark Dickinson
ad476dab09
Issue #5816 : Simplify code for parsing and printing of complex numbers.
nans and infs are no longer given special treatment; as a result,
repr(complex(z)) recovers z for any complex number z.
17 years ago
Eric Smith
0923d1d8d7
The other half of Issue #1580 : use short float repr where possible.
Addresses the float -> string conversion, using David Gay's code which
was added in Mark Dickinson's checkin r71663.
Also addresses these, which are intertwined with the short repr
changes:
- Issue #5772 : format(1e100, '<') produces '1e+100', not '1.0e+100'
- Issue #5515 : 'n' formatting with commas no longer works poorly
with leading zeros.
- PEP 378 Format Specifier for Thousands Separator: implemented
for floats.
17 years ago
Mark Dickinson
e94c679df0
Issue #1717 : rename tp_compare to tp_reserved. I'll change the
type of tp_compare in a separate commit, for ease of reversion
should things go wrong.
18 years ago
Mark Dickinson
8055afd019
Issue #4910 , patch 3/3: rename nb_long to nb_reserved
18 years ago
Mark Dickinson
cce2f217d4
Issue 4910, patch 2 of (probably) 3: pave the way for renaming of
nb_long: remove last remaining use of nb_long
(in the struct module) from the core, set nb_long slots on all builtin
and extension types to 0, and remove uses of __long__ in test_complex
and test_binop.
Reviewed by Benjamin Peterson.
18 years ago
Benjamin Peterson
4f92ca4022
Remove nb_reserved (nb_coerce), nb_hex, and nb_oct from PyNumberMethods
18 years ago
Georg Brandl
0c77a82c3d
Merged revisions 63829-63831,63858,63865,63879,63882,63948,63970-63972,63976,63989,64014-64015,64021-64022,64063-64065,64067 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r63829 | mark.summerfield | 2008-05-31 15:05:34 +0200 (Sat, 31 May 2008) | 4 lines
Added a note to [] that special forms & special chars lose their meaning
and backrefs can't be used inside []
........
r63830 | georg.brandl | 2008-05-31 16:40:09 +0200 (Sat, 31 May 2008) | 2 lines
#3010 : clarification about stdin/use_rawinput.
........
r63831 | georg.brandl | 2008-05-31 16:45:55 +0200 (Sat, 31 May 2008) | 2 lines
#3005 : add explaining sentence to easydialogs docs.
........
r63858 | georg.brandl | 2008-06-01 18:41:31 +0200 (Sun, 01 Jun 2008) | 2 lines
Add plain text make target.
........
r63865 | georg.brandl | 2008-06-01 21:24:36 +0200 (Sun, 01 Jun 2008) | 2 lines
Spaces vs. tabs.
........
r63879 | gregory.p.smith | 2008-06-02 00:57:47 +0200 (Mon, 02 Jun 2008) | 3 lines
Make the _H #define's match the header file names. Fix comments to
mention the correct type names.
........
r63882 | gregory.p.smith | 2008-06-02 01:48:47 +0200 (Mon, 02 Jun 2008) | 3 lines
Adds a Thread.getIdent() method to provide the _get_ident() value for
any given threading.Thread object. feature request issue 2871.
........
r63948 | alexandre.vassalotti | 2008-06-04 22:41:44 +0200 (Wed, 04 Jun 2008) | 2 lines
Fixed complex.__getnewargs__() to not emit another complex object.
........
r63970 | andrew.kuchling | 2008-06-06 01:33:54 +0200 (Fri, 06 Jun 2008) | 1 line
Document 'utc' parameter
........
r63971 | andrew.kuchling | 2008-06-06 01:35:31 +0200 (Fri, 06 Jun 2008) | 1 line
Add various items
........
r63972 | andrew.kuchling | 2008-06-06 01:35:48 +0200 (Fri, 06 Jun 2008) | 1 line
Grammar fix
........
r63976 | georg.brandl | 2008-06-06 09:34:50 +0200 (Fri, 06 Jun 2008) | 2 lines
Markup fix.
........
r63989 | thomas.heller | 2008-06-06 20:42:11 +0200 (Fri, 06 Jun 2008) | 2 lines
Add a reminder for the maintainer of whatsnew.
........
r64014 | georg.brandl | 2008-06-07 17:59:10 +0200 (Sat, 07 Jun 2008) | 3 lines
Factor out docstring dedenting from inspect.getdoc() into inspect.cleandoc()
to ease standalone use of the algorithm.
........
r64015 | georg.brandl | 2008-06-07 18:04:01 +0200 (Sat, 07 Jun 2008) | 2 lines
Revert unwanted changes.
........
r64021 | georg.brandl | 2008-06-07 20:16:12 +0200 (Sat, 07 Jun 2008) | 2 lines
X-ref to numbers module.
........
r64022 | georg.brandl | 2008-06-07 20:17:37 +0200 (Sat, 07 Jun 2008) | 3 lines
Document the "st" API, to avoid confusion with the "new" AST.
Add a note about using the new AST module.
........
r64063 | martin.v.loewis | 2008-06-10 07:03:35 +0200 (Tue, 10 Jun 2008) | 2 lines
Add Gregor Lingl.
........
r64064 | georg.brandl | 2008-06-10 09:45:28 +0200 (Tue, 10 Jun 2008) | 2 lines
Add the "ast" module, containing helpers to ease use of the "_ast" classes.
........
r64065 | raymond.hettinger | 2008-06-10 09:57:15 +0200 (Tue, 10 Jun 2008) | 1 line
Add Arnaud for his efforts on multi-arg set operations.
........
r64067 | georg.brandl | 2008-06-10 14:46:39 +0200 (Tue, 10 Jun 2008) | 2 lines
#2536 : fix itertools.permutations and itertools.combinations docstrings.
........
18 years ago
Gregory P. Smith
dd96db63f6
This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
18 years ago