| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
tuple.index()"
Issue #13340.
|
|
|
|
| |
Closes #13340.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
of "seq(uence)", use "new" to show that set() always returns a new object.
|
| |
|
|
|
|
| |
step value. Patch by Marcin Bachry.
|
| |
|
| |
|
|
|
|
| |
thread, and mutating it from another one. Patch by Scott Dial.
|
| |
|
| |
|
| |
|
|
|
|
| |
be blocked explicitly so that collections.Hashable remains meaningful
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
EOL 80 limit and supply more alternatives in warning messages.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Py_REFCNT. Macros for b/w compatibility are available.
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
Factor-out common calling code by simplifying the length_hint API.
Speed-up the function by caching the PyObject_String for the attribute lookup.
|
|
|
|
| |
can make list() raise a SystemError
|
|
|
|
| |
With some changes of my own thrown in (e.g. backport of r58107).
|
|
|
|
|
|
| |
Introduce overflow checking into list_inplace_repeat.
Backport candidate, possibly.
|
|
|
|
|
|
| |
PyObject_Print().
Closes issue #1164.
|
|
|
|
| |
Closes issue #1096.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of some of the common builtin types.
Use a bit in tp_flags for each common builtin type. Check the bit
to determine if any instance is a subclass of these common types.
The check avoids a function call and O(n) search of the base classes.
The check is done in the various Py*_Check macros rather than calling
PyType_IsSubtype().
All the bits are set in tp_flags when the type is declared
in the Objects/*object.c files because PyType_Ready() is not called
for all the types. Should PyType_Ready() be called for all types?
If so and the change is made, the changes to the Objects/*object.c files
can be reverted (remove setting the tp_flags). Objects/typeobject.c
would also have to be modified to add conditions
for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
|
| |
|
|
|
|
| |
Will backport.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unified the way intobject, longobject and mystrtoul handle
values around -sys.maxint-1.
* in general, trying to entierely avoid overflows in any computation
involving signed ints or longs is extremely involved. Fixed a few
simple cases where a compiler might be too clever (but that's all
guesswork).
* more overflow checks against bad data in marshal.c.
* 2.5 specific: fixed a number of places that were still confusing int
and Py_ssize_t. Some of them could potentially have caused
"real-world" breakage.
* list.pop(x): fixing overflow issues on x was messy. I just reverted
to PyArg_ParseTuple("n"), which does the right thing. (An obscure
test was trying to give a Decimal to list.pop()... doesn't make
sense any more IMHO)
* trying to write a few tests...
|
|
|
|
|
|
| |
Klocwork 286-287.
(I'm not backporting this, but if someone wants to, feel free.)
|
|
|
|
|
|
|
| |
I modified this patch some by fixing style, some error checking, and adding
XXX comments. This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward. I don't want this to hold up release if possible.
|
|
|
|
|
|
| |
Check seq in both portions of if/else.
Klocwork #289-290.
|
|
|
|
| |
Backport candidate
|