Serhiy Storchaka
b7a2c17be8
[2.7] bpo-32137: The repr of deeply nested dict now raises a RuntimeError (GH-4570) ( #5493 )
...
instead of crashing due to a stack overflow.
This perhaps will fix similar problems in other extension types.
(cherry picked from commit 1fb72d2ad2
)
2018-02-02 16:29:02 +02:00
Serhiy Storchaka
5e79321742
bpo-30074: Fix compile warnings of _PySlice_Unpack and convert missed ( #1154 )
...
PySlice_GetIndicesEx in _ctypes.c.
2017-04-15 20:11:12 +03:00
Serhiy Storchaka
e41390aca5
bpo-27867: Expand the PySlice_GetIndicesEx macro. ( #1023 ) ( #1046 )
...
(cherry picked from commit b879fe8
)
2017-04-08 11:48:57 +03:00
Serhiy Storchaka
079f21f873
bpo-29935: Fixed error messages in the index() method of tuple and list ( #887 ) ( #907 ) ( #910 )
...
when pass indices of wrong type.
(cherry picked from commit d4edfc9abf
)
(cherry picked from commit bf4bb2e430
)
2017-03-30 20:32:18 +03:00
Benjamin Peterson
d4d7900307
make sure to not call memcpy with a NULL second argument
2016-09-06 17:58:25 -07:00
Serhiy Storchaka
14a7d6389f
Issue #26494 : Fixed crash on iterating exhausting iterators.
...
Affected classes are generic sequence iterators, iterators of bytearray,
list, tuple, set, frozenset, dict, OrderedDict and corresponding views.
2016-03-30 20:43:06 +03:00
Serhiy Storchaka
c06a6d0958
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
...
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:07:48 +02:00
Benjamin Peterson
082a960425
fix merge_collapse to actually maintain the invariant it purports to ( closes #23515 )
...
See
de Gouw, Stijn and Rot, Jurriaan and de Boer, Frank S and Bubel, Richard and Hähnle, Reiner
"OpenJDK’s java.utils.Collection.sort() is broken: The good, the bad and the worst case"
2015-02-25 10:12:26 -05:00
Petri Lehtinen
3b9d92aefe
Revert "Accept None as start and stop parameters for list.index() and tuple.index()"
...
Issue #13340 .
2011-11-06 20:59:01 +02:00
Petri Lehtinen
819d8d447d
Accept None as start and stop parameters for list.index() and tuple.index()
...
Closes #13340 .
2011-11-05 23:18:06 +02:00
Mark Dickinson
4ac5d2cda4
Backport issue #12973 list_repeat fix from 3.x.
2011-09-19 19:23:55 +01:00
Ezio Melotti
c2077b0d9b
#11565 : Fix several typos. Patch by Piotr Kasprzyk.
2011-03-16 12:34:31 +02:00
Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
2010-05-09 14:46:46 +00:00
Ezio Melotti
fb501123e3
#8030 : more docstring fix for builtin types.
2010-02-28 23:59:00 +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
Mark Dickinson
ac5685eb67
Silence some 'comparison between signed and unsigned' compiler warnings.
2010-02-14 12:16:43 +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
Benjamin Peterson
c45a0cfb5f
grant list.index() a more informative error message #7252
2009-11-02 16:14:19 +00:00
Benjamin Peterson
e2caf1f60e
prevent a rather unlikely segfault
2009-11-02 15:06:45 +00:00
Antoine Pitrou
beaf6a02f4
Issue #7084 : Fix a (very unlikely) crash when printing a list from one
...
thread, and mutating it from another one. Patch by Scott Dial.
2009-10-11 21:03:26 +00:00
Raymond Hettinger
b516370bcb
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
2009-02-02 21:50:13 +00:00
Raymond Hettinger
7989a4dccb
Backport r67478
2008-12-03 15:42:10 +00:00
Andrew M. Kuchling
d810cdf849
Docstring changes: Specify exceptions raised
2008-10-04 01:04:24 +00:00
Nick Coghlan
53663a695e
Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful
2008-07-15 14:27:37 +00:00
Gregory P. Smith
9d53457e59
Merge in release25-maint r60793:
...
Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
2008-06-11 07:41:16 +00:00
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.
2008-06-09 04:58:54 +00:00
Georg Brandl
7a6de8b0f4
Some style nits. Also clarify in the docstrings what __sizeof__ does.
2008-06-01 16:42:16 +00:00
Robert Schuppenies
51df064767
Issue #2898 : Added sys.getsizeof() to retrieve size of objects in bytes.
2008-06-01 16:16:17 +00:00
Christian Heimes
593daf545b
Renamed PyString to PyBytes
2008-05-26 12:51:38 +00:00
Benjamin Peterson
f19a7b90bd
A little reformating of Py3k warnings
2008-04-27 18:40:21 +00:00
Benjamin Peterson
9f4f48114f
Use PyErr_WarnPy3k throughout
2008-04-27 03:01:45 +00:00
Georg Brandl
d5b635f196
Make Py3k warnings consistent w.r.t. punctuation; also respect the
...
EOL 80 limit and supply more alternatives in warning messages.
2008-03-25 08:29:14 +00:00
Raymond Hettinger
05387861ea
Issue 2354: Fix-up compare warning. Patch contributed by Jeff Balogh.
2008-03-19 17:45:19 +00:00
Raymond Hettinger
6c0ff8aacd
Issue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted().
2008-03-18 23:33:08 +00:00
Christian Heimes
09bde04154
Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal.
2008-02-24 12:26:16 +00:00
Christian Heimes
48397d6c22
Use prefix decrement
2008-02-08 00:14:34 +00:00
Christian Heimes
b4ee4a16f4
Added some statistics code to dict and list object code. I wanted to test how a larger freelist affects the reusage of freed objects. Contrary to my gut feelings 80 objects is more than fine for small apps. I haven't profiled a large app yet.
2008-02-07 17:15:30 +00:00
Christian Heimes
5b970ad483
Unified naming convention for free lists and their limits. All free lists
...
in Object/ are named ``free_list``, the counter ``numfree`` and the upper
limit is a macro ``PyName_MAXFREELIST`` inside an #ifndef block.
The chances should make it easier to adjust Python for platforms with
less memory, e.g. mobile phones.
2008-02-06 13:33:44 +00:00
Thomas Wouters
a97744c9d9
Use the right (portable) definition of the max of a Py_ssize_t.
2008-01-25 21:09:34 +00:00
Guido van Rossum
8d5cf4ed57
Rewrite the list_inline_repeat overflow check slightly differently.
2008-01-25 19:50:26 +00:00
Christian Heimes
e93237dfcc
#1629 : Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
2007-12-19 02:37:44 +00:00
Raymond Hettinger
6c87af5d87
Optimize PyList_AsTuple(). Improve cache performance by doing the
...
pointer copy and object increment in one pass. For small lists,
save the overhead of the call to memcpy() -- this comes up in
calls like f(*listcomp).
2007-12-15 00:07:25 +00:00
Raymond Hettinger
4e2f714031
Fix Issue 1045.
...
Factor-out common calling code by simplifying the length_hint API.
Speed-up the function by caching the PyObject_String for the attribute lookup.
2007-12-06 00:56:53 +00:00
Christian Heimes
fe4826f6ac
merge -r59315:59316 from py3k: Fix issue #1553 : An errornous __length_hint__ can make list() raise a SystemError
2007-12-05 12:49:14 +00:00
Guido van Rossum
64c06e327d
Backport of _abccoll.py by Benjamin Arangueren, issue 1383.
...
With some changes of my own thrown in (e.g. backport of r58107).
2007-11-22 00:55:51 +00:00
Armin Rigo
a1e42e11d5
Fix the overflow checking of list_repeat.
...
Introduce overflow checking into list_inplace_repeat.
Backport candidate, possibly.
2007-10-17 18:46:37 +00:00
Brett Cannon
0153159e67
Add a bunch of GIL release/acquire points in tp_print implementations and for
...
PyObject_Print().
Closes issue #1164 .
2007-09-17 03:28:34 +00:00
Brett Cannon
a0c05512ec
Fix a possible segfault from recursing too deep to get the repr of a list.
...
Closes issue #1096 .
2007-09-10 21:38:27 +00:00
Thomas Wouters
3ccec68a05
Improve extended slicing support in builtin types and classes. Specifically:
...
- Specialcase extended slices that amount to a shallow copy the same way as
is done for simple slices, in the tuple, string and unicode case.
- Specialcase step-1 extended slices to optimize the common case for all
involved types.
- For lists, allow extended slice assignment of differing lengths as long
as the step is 1. (Previously, 'l[:2:1] = []' failed even though
'l[:2] = []' and 'l[:2:None] = []' do not.)
- Implement extended slicing for buffer, array, structseq, mmap and
UserString.UserString.
- Implement slice-object support (but not non-step-1 slice assignment) for
UserString.MutableString.
- Add tests for all new functionality.
2007-08-28 15:28:19 +00:00
Martin v. Löwis
6819210b9e
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
...
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00