Commit Graph

3260 Commits

Author SHA1 Message Date
Ezio Melotti fb501123e3 #8030: more docstring fix for builtin types. 2010-02-28 23:59:00 +00:00
Georg Brandl b36e63a5ee The set types can also be called without arguments. 2010-02-28 18:26:37 +00:00
Georg Brandl bca1169e94 #8030: make builtin type docstrings more consistent: use "iterable" instead of "seq(uence)", use "new" to show that set() always returns a new object. 2010-02-28 18:19:17 +00:00
Ezio Melotti 321251567e #7649: "u'%c' % char" now behaves like "u'%s' % char" and raises a UnicodeDecodeError if 'char' is a byte string that can't be decoded using the default encoding. 2010-02-25 17:36:04 +00:00
Eric Smith 2d9856d6ce Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings. 2010-02-24 14:15:36 +00:00
Victor Stinner f20f9c299e Issue #7649: Fix u'%c' % char for character in range 0x80..0xFF
=> raise an UnicodeDecodeError. Patch written by Ezio Melotti.
2010-02-23 23:16:07 +00:00
Eric Smith 87bcb243ac Issue #6902: Fix problem with built-in types format incorrectly with 0 padding. 2010-02-23 00:11:16 +00:00
Andrew M. Kuchling 00b6a5c03d #7706: DONT_HAVE_ERRNO_H is no longer defined by configure (after rev.46819). 2010-02-22 23:10:52 +00:00
Eric Smith f32d4acead Issue #7988: Fix default alignment to be right aligned for complex.__format__. Now it matches other numeric types. 2010-02-22 18:33:47 +00:00
Ezio Melotti bce3e17bd2 #7482: clarify error message in case of division by zero of float and complex numbers. 2010-02-22 16:30:58 +00:00
Mark Dickinson 82b34c5dbe Issue #5211: Fix complex type to avoid implicit calls to
complex.__coerce__.  Thanks Meador Inge for the patch.
2010-02-21 12:57:35 +00:00
Mark Dickinson 2d7911eda4 Silence more compiler warnings; fix an instance of potential undefined behaviour from signed overflow. 2010-02-14 12:31:26 +00:00
Mark Dickinson ac5685eb67 Silence some 'comparison between signed and unsigned' compiler warnings. 2010-02-14 12:16:43 +00:00
Antoine Pitrou bb445a1f22 Issue #5677: Explicitly forbid write operations on read-only file objects,
and read operations on write-only file objects.  On Windows, the system C
library would return a bogus result; on Solaris, it was possible to crash
the interpreter.  Patch by Stefan Krah.
2010-02-05 17:05:54 +00:00
Antoine Pitrou 526e421b12 Issue #7385: Fix a crash in `MemoryView_FromObject` when
`PyObject_GetBuffer` fails.  Patch by Florent Xicluna.
2010-02-02 22:36:17 +00:00
Mark Dickinson a36507c64c Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a
long long variant of PyLong_AsLongAndOverflow.  Patch by Case Van
Horsen.
2010-01-30 10:08:33 +00:00
Mark Dickinson 36ecd676ea Issue #7788: Fix a crash produced by deleting a list slice with huge
step value.  Patch by Marcin Bachry.
2010-01-29 17:11:39 +00:00
Ezio Melotti 1fafaab5e5 #7775: fixed docstring for rpartition 2010-01-25 11:24:37 +00:00
Antoine Pitrou e80a6a4ead Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)
could crash in many places because of the PyByteArray_AS_STRING() macro
returning NULL.  The macro now returns a statically allocated empty
string instead.
2010-01-17 12:26:20 +00:00
Georg Brandl aee900338e Add note about usage of STRINGLIB_EMPTY. 2010-01-17 12:14:42 +00:00
Ezio Melotti d234208588 Fixed typo 2010-01-14 11:34:10 +00:00
Antoine Pitrou 10042922d9 Sanitize bloom filter macros 2010-01-13 14:01:26 +00:00
Antoine Pitrou a913a20c91 Test commit to try to diagnose failures of the IA-64 buildbot 2010-01-13 13:43:37 +00:00
Antoine Pitrou 5c767c2f87 Fix Windows build (re r77461) 2010-01-13 08:55:20 +00:00
Antoine Pitrou 6467213bfd Issue #7622: Improve the split(), rsplit(), splitlines() and replace()
methods of bytes, bytearray and unicode objects by using a common
implementation based on stringlib's fast search.  Patch by Florent Xicluna.
2010-01-13 07:55:48 +00:00
Alexandre Vassalotti 58a96efde5 Fixed repr of dictionary views. 2010-01-12 01:34:43 +00:00
Alexandre Vassalotti 69eb51697c Issue #1967: Backport dictionary views. 2010-01-11 23:17:10 +00:00
Benjamin Peterson 3694366af5 factor out __complex__ lookup code to fix another case 2010-01-04 01:00:47 +00:00
Benjamin Peterson ecdae19fbe do correct lookup of the __complex__ method 2010-01-04 00:43:01 +00:00
Antoine Pitrou 5b7139aab4 Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
`rindex`, `rsplit` and `rpartition` methods.  Patch by Florent Xicluna.
2010-01-02 21:12:58 +00:00
Mark Dickinson d3e323215c Refactor some longobject internals: PyLong_AsDouble and _PyLong_AsScaledDouble
(the latter renamed to _PyLong_Frexp) now use the same core code.  The
exponent produced by _PyLong_Frexp now has type Py_ssize_t instead of the
previously used int, and no longer needs scaling by PyLong_SHIFT.  This
frees the math module from having to know anything about the PyLong
implementation.  This closes issue #5576.
2010-01-02 14:45:40 +00:00
Mark Dickinson 99d652ef66 Issue #7534: Fix handling of nans, infinities, and negative zero in **
operator, on IEEE 754 platforms.  Thanks Marcos Donolo for original patch.
2009-12-30 12:12:23 +00:00
Mark Dickinson 4657283647 Issue #1811: Improve accuracy and consistency of true division for integers. 2009-12-27 14:55:57 +00:00
Ezio Melotti f84caf4eda #6108: unicode(exception) and str(exception) should return the same message 2009-12-24 22:25:17 +00:00
Mark Dickinson e31d300664 Issue #7528: Backport PyLong_AsLongAndOverflow from py3k to trunk.
Thanks Case Van Horsen for the patch.
2009-12-21 11:21:25 +00:00
Benjamin Peterson 0c0dcaf272 remove type_compare, since type_richcompare does the same trick 2009-12-16 03:36:22 +00:00
R. David Murray 0a0a1a842c Issue #1680159: unicode coercion during an 'in' operation was masking
any errors that might occur during coercion of the left operand and
turning them into a TypeError with a message text that was confusing in
the given context.  This patch lets any errors through, as was already
done during coercion of the right hand side.
2009-12-14 16:28:26 +00:00
Benjamin Peterson 4895af4ef1 fix the ignoring of __cmp__ method on metaclasses #7491 2009-12-13 16:36:53 +00:00
Antoine Pitrou c169c781a8 Issue #7466: segmentation fault when the garbage collector is called
in the middle of populating a tuple.  Patch by Florent Xicluna.

(note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1)
2009-12-12 19:13:08 +00:00
Benjamin Peterson 5fb877027b substitute PyDict_Check() for PyObject_IsInstance 2009-12-10 03:37:59 +00:00
Mark Dickinson 1691025ff2 Avoid undefined behaviour due to overflow in i_divmod (Objects/intobject.c). 2009-12-04 11:24:38 +00:00
Benjamin Peterson 91c12ebc3d disable pymalloc tricks with the --with-valgrind option #2422
Patch from James Henstridge.
2009-12-03 02:52:39 +00:00
Mark Dickinson 34398184eb Issue #7406: Fix some occurrences of potential signed overflow in int
arithmetic.
2009-12-02 17:33:41 +00:00
Eric Smith c4ab8339e9 Issue #3382: Make '%F' and float.__format__('F') convert results to upper case. Much of the patch came from Mark Dickinson. 2009-11-29 17:40:57 +00:00
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.
2009-11-28 12:30:36 +00:00
Mark Dickinson 9dd5e16c5d Issue #7117, continued: Remove substitution of %g-style formatting for
%f-style formatting, which used to occur at high precision.  Float formatting
should now be consistent between 2.7 and 3.1.
2009-11-23 20:54:09 +00:00
Mark Dickinson 18cfada1ea Remove restriction on precision when formatting floats. This is the
first step towards removing the %f -> %g switch (see issues 7117,
5859).
2009-11-23 18:46:41 +00:00
Benjamin Peterson dc3c239b1e #5037 proxy __unicode__ correctly 2009-11-19 03:00:02 +00:00
Raymond Hettinger 79628d311f Issue 7263: Fix set.intersection() docstring. 2009-11-18 20:28:22 +00:00
Mark Dickinson bd15a06fd3 Issue #7117, continued: Change round implementation to use the correctly-rounded
string <-> float conversions;  this makes sure that the result of the round
operation is correctly rounded, and hence displays nicely using the new float
repr.
2009-11-18 19:33:35 +00:00