summaryrefslogtreecommitdiffstats
path: root/Objects/complexobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()Serhiy Storchaka2015-02-021-1/+8
|\ | | | | | | and PyObject_AsWriteBuffer().
| * Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()Serhiy Storchaka2015-02-021-1/+8
| | | | | | | | and PyObject_AsWriteBuffer().
* | Issue #22604: Fix assertion error in debug mode when dividing a complex ↵Antoine Pitrou2014-10-101-2/+6
|\ \ | |/ | | | | number by (nan+0j).
| * Issue #22604: Fix assertion error in debug mode when dividing a complex ↵Antoine Pitrou2014-10-101-2/+6
| | | | | | | | number by (nan+0j).
* | Issue #21803: remove macro indirections in complexobject.hAntoine Pitrou2014-07-071-17/+17
|/
* Silence expression result unused warnings with clang.Christian Heimes2013-12-041-1/+1
| | | | | | | | | | | | 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.
* #17080: improve error message of float/complex when the wrong type is passed.Ezio Melotti2013-11-071-4/+6
|
* #19068: merge with 3.3.Ezio Melotti2013-10-051-2/+2
|\
| * #19068: use imperative mood in complex object docstrings. Patch by Marco Buttu.Ezio Melotti2013-10-051-2/+2
| |
* | Issue #18722: Remove uses of the "register" keyword in C code.Antoine Pitrou2013-08-131-1/+1
| |
* | Close #17694: Add minimum length to _PyUnicodeWriterVictor Stinner2013-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Issue #16290: __complex__ must now always return an instance of complex.Mark Dickinson2012-11-141-6/+6
|/
* Issue #14744: Use the new _PyUnicodeWriter internal API to speed up str%args ↵Victor Stinner2012-05-291-3/+14
| | | | | | | | | | | | | | | | | 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.
* use the static identifier api for looking up special methodsBenjamin Peterson2012-01-221-2/+2
| | | | | I had to move the static identifier code from unicodeobject.h to object.h in order for this to work.
* Implement PEP 393.Martin v. Löwis2011-09-281-15/+4
|
* Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.Brian Curtin2011-08-111-2/+1
| | | | The macro was introduced in #12724.
* Issue #10833: Use PyErr_Format() and PyUnicode_FromFormat() instead ofVictor Stinner2011-03-211-13/+1
| | | | | PyOS_snprintf() to avoid temporary buffer allocated on the stack and a conversion from bytes to Unicode.
* Removed static function complex_format, moved it into complex_repr. Modified ↵Eric Smith2010-12-041-10/+8
| | | | tests to check both str and repr, which are the same for complex.
* Issue #10557: Fixed error messages from float() and other numericAlexander Belopolsky2010-12-041-13/+17
| | | | | | types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
* #6780: fix complex() constructor TypeError messageVictor Stinner2010-12-031-1/+1
|
* follow up to #9778: define and use an unsigned hash typeBenjamin Peterson2010-10-231-7/+7
|
* make hashes always the size of pointers; introduce Py_hash_t #9778Benjamin Peterson2010-10-171-2/+2
|
* Issue #9337: Make float.__str__ identical to float.__repr__.Mark Dickinson2010-08-041-7/+1
| | | | (And similarly for complex numbers.)
* Issue #8188: Introduce a new scheme for computing hashes of numbersMark Dickinson2010-05-231-9/+9
| | | | | | (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.
* Issue #8748: Fix two issues with comparisons between complex and integerMark Dickinson2010-05-211-8/+44
| | | | | | | | | | 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.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-806/+806
| | | | | | | | | | 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. ........
* Issue #7845: Make 1j.__le__(2j) return NotImplemented rather than raising ↵Mark Dickinson2010-03-131-4/+2
| | | | TypeError.
* Merged revisions 78319 via svnmerge fromEzio Melotti2010-02-221-1/+1
| | | | | | | | | | 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. ........
* Merged revisions 77292-77293 via svnmerge fromBenjamin Peterson2010-01-041-36/+26
| | | | | | | | | | | | | | 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 ........
* Merged revisions 76561 via svnmerge fromMark Dickinson2009-11-281-4/+0
| | | | | | | | | | | | | 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. ........
* Make sure memory is freed on error in complex_subtype_from_string.Mark Dickinson2009-10-261-8/+7
|
* Remove length limitation on string arguments to complex()Mark Dickinson2009-10-261-7/+11
|
* Issue 7147 - remove ability to attempt to build Python without complex ↵Skip Montanaro2009-10-181-4/+0
| | | | number support (was broken anyway)
* Issue #5829: complex('1e500') shouldn't raise OverflowErrorMark Dickinson2009-05-201-2/+2
|
* Merged revisions 72718 via svnmerge fromMark Dickinson2009-05-171-2/+2
| | | | | | | | | | | 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. ........
* Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith2009-05-051-6/+6
| | | | 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.
* Merged revisions 72253 via svnmerge fromMark Dickinson2009-05-031-4/+4
| | | | | | | | | | 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. ........
* Issue #5914: Add new C-API function PyOS_string_to_double, to complementMark Dickinson2009-05-031-18/+14
| | | | PyOS_double_to_string, and deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
* Issue #1588: Add complex.__format__.Eric Smith2009-04-301-0/+19
|
* Merged revisions 71963 via svnmerge fromMark Dickinson2009-04-261-2/+2
| | | | | | | | | | 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. ........
* Merged revisions 71869 via svnmerge fromMark Dickinson2009-04-251-1/+1
| | | | | | | | | | 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. ........
* Make sure that complex parsing code and corresponding testsMark Dickinson2009-04-241-26/+85
| | | | | match for 2.7 and 3.1, and that 3.1 continues to accept complex('j') and complex('4-j')
* Issue #5816: Simplify code for parsing and printing of complex numbers.Mark Dickinson2009-04-231-215/+103
| | | | | nans and infs are no longer given special treatment; as a result, repr(complex(z)) recovers z for any complex number z.
* The other half of Issue #1580: use short float repr where possible.Eric Smith2009-04-161-70/+97
| | | | | | | | | | | | | | 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.
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Issue #4910, patch 3/3: rename nb_long to nb_reservedMark Dickinson2009-01-171-1/+1
|
* Issue 4910, patch 2 of (probably) 3: pave the way for renaming ofMark Dickinson2009-01-151-9/+1
| | | | | | | | | 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.
* Remove nb_reserved (nb_coerce), nb_hex, and nb_oct from PyNumberMethodsBenjamin Peterson2008-06-111-3/+0
|
* Merged revisions ↵Georg Brandl2008-06-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* Merged revisions 62380,62382-62383 via svnmerge fromChristian Heimes2008-04-191-3/+61
| | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r62380 | christian.heimes | 2008-04-19 01:13:07 +0200 (Sat, 19 Apr 2008) | 3 lines I finally got the time to update and merge Mark's and my trunk-math branch. The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :) ........ r62382 | christian.heimes | 2008-04-19 01:40:40 +0200 (Sat, 19 Apr 2008) | 2 lines Added new files to Windows project files More Windows related fixes are coming soon ........ r62383 | christian.heimes | 2008-04-19 01:49:11 +0200 (Sat, 19 Apr 2008) | 1 line Stupid me. Py_RETURN_NAN should actually return something ... ........