Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Really address the issue of where to place the assert for leftblock. | Neal Norwitz | 2006-08-13 | 1 | -1/+1 |
| | | | | (Followup of Klocwork 274) | ||||
* | Move the assert which checks for a NULL pointer first. | Neal Norwitz | 2006-08-12 | 1 | -1/+1 |
| | | | | Klocwork #274. | ||||
* | defdict_reduce(): Plug leaks. | Tim Peters | 2006-07-28 | 1 | -10/+11 |
| | | | | | | | We didn't notice these before because test_defaultdict didn't actually do anything before Georg fixed that earlier today. Neal's next refleak run then showed test_defaultdict leaking 9 references on each run. That's repaired by this checkin. | ||||
* | Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, for | Thomas Wouters | 2006-04-15 | 1 | -4/+1 |
| | | | | tp_clear methods. | ||||
* | SF Bug #1448488 - make collectionsmodule build on Cygwin, using the same | Anthony Baxter | 2006-04-04 | 1 | -2/+6 |
| | | | | techniques as in Modules/xxsubtype.c | ||||
* | Remove unnecessary casts from type object initializers. | Georg Brandl | 2006-03-30 | 1 | -4/+4 |
| | |||||
* | - Patch 1433928: | Guido van Rossum | 2006-02-25 | 1 | -1/+265 |
| | | | | | | | | - The copy module now "copies" function objects (as atomic objects). - dict.__getitem__ now looks for a __missing__ hook before raising KeyError. - Added a new type, defaultdict, to the collections module. This uses the new __missing__ hook behavior added to dict (see above). | ||||
* | Use Py_ssize_t for counts and sizes. | Martin v. Löwis | 2006-02-16 | 1 | -1/+1 |
| | |||||
* | Merge ssize_t branch. | Martin v. Löwis | 2006-02-15 | 1 | -8/+8 |
| | |||||
* | Renamed _length_cue() to __length_hint__(). See: | Armin Rigo | 2006-02-11 | 1 | -2/+2 |
| | | | | http://mail.python.org/pipermail/python-dev/2006-February/060524.html | ||||
* | Check return result from Py_InitModule*(). This API can fail. | Neal Norwitz | 2006-01-19 | 1 | -0/+2 |
| | | | | Probably should be backported. | ||||
* | Convert iterator __len__() methods to a private API. | Raymond Hettinger | 2005-09-24 | 1 | -7/+11 |
| | |||||
* | Disallow keyword arguments for type constructors that don't use them. | Georg Brandl | 2005-08-26 | 1 | -0/+3 |
| | | | | (fixes bug #1119418) | ||||
* | Apply remove's mutation test after every equality test. | Raymond Hettinger | 2005-03-19 | 1 | -7/+7 |
| | |||||
* | Add a remove() method to collections.deque objects. | Raymond Hettinger | 2005-03-18 | 1 | -1/+38 |
| | |||||
* | SF patch #1062279: deque pickling problems | Raymond Hettinger | 2004-11-09 | 1 | -10/+12 |
| | | | | | | | (Contributed by Dima Dorfman.) * Support pickling of dictionaries in instances of deque subclasses. * Support pickling of recursive deques. | ||||
* | Bump-up block size. | Raymond Hettinger | 2004-11-02 | 1 | -1/+1 |
| | |||||
* | Simplify delitem() code by calling rotate() directly instead of using | Raymond Hettinger | 2004-10-09 | 1 | -35/+23 |
| | | | | arguments passed through tuples. | ||||
* | Armin's patch to prevent overflows. | Raymond Hettinger | 2004-10-06 | 1 | -7/+22 |
| | |||||
* | Upon insertion, if memory runs out, the deque was left in a corrupted state. | Armin Rigo | 2004-10-02 | 1 | -34/+34 |
| | | | | | | | | | | | | | | | | | | | | | | | | | deque_item(): a performance bug: the linked list of blocks was followed from the left in most cases, because the test (i < (deque->len >> 1)) was after "i %= BLOCKLEN". deque_clear(): replaced a call to deque_len() with deque->len; not sure what this call was here for, nor if all compilers under the sun would inline it. deque_traverse(): I belive that it could be called by the GC when the deque has leftblock==rightblock==NULL, because it is tracked before the first block is allocated (though closely before). Still, a C extension module subclassing deque could provide its own tp_alloc that could trigger a GC collection after the PyObject_GC_Track()... deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of relying on deque.__iter__().next() to succeed exactly len(deque) times -- an assumption which can break if deques are subclassed. Added a test. I wonder if the length should be explicitely bounded to INT_MAX, with OverflowErrors, as in listobject.c. On 64-bit machines, adding more than INT_MAX in the deque will result in trouble. (Note to anyone/me fixing this: carefully check for overflows if len is close to INT_MAX in the following functions: deque_rotate(), deque_item(), deque_ass_item()) | ||||
* | * Bulletproof the method for detecting mutations during iteration. | Raymond Hettinger | 2004-10-02 | 1 | -18/+32 |
| | | | | | | | | | The previous approach was too easily fooled (a rotate() sufficed). * Use it->counter to determine when iteration is complete. The previous approach was too complex. * Strengthen an assertion and add a comment here or there. | ||||
* | Restore the block length and add a comment. | Raymond Hettinger | 2004-10-01 | 1 | -1/+7 |
| | |||||
* | Clarify the relationship between indices. | Raymond Hettinger | 2004-10-01 | 1 | -5/+7 |
| | |||||
* | * Elaborate on the invariant comments and make them more precise. | Raymond Hettinger | 2004-10-01 | 1 | -14/+28 |
| | | | | | | * Change the centering by one to make it possible to test the module with BLOCKLEN's as low as two. Testing small blocks makes end-point errors surface more readily. | ||||
* | deque_traverse(): If the deque had one block, and its rightindex was | Tim Peters | 2004-10-01 | 1 | -10/+13 |
| | | | | | BLOCKLEN-1, this assert-failed in a debug build, or went wild with a NULL pointer in a release build. Reported on c.l.py by Stefan Behnel. | ||||
* | Typos in new comments. | Tim Peters | 2004-10-01 | 1 | -2/+2 |
| | |||||
* | Document some reverse-engineered invariants and pragmatic hints. | Tim Peters | 2004-10-01 | 1 | -2/+17 |
| | |||||
* | Definition consistency. | Tim Peters | 2004-10-01 | 1 | -1/+2 |
| | |||||
* | Trimmed trailing whitespace. | Tim Peters | 2004-10-01 | 1 | -26/+26 |
| | |||||
* | Silence a GCC unused variable warning in debug builds. | Raymond Hettinger | 2004-07-19 | 1 | -2/+1 |
| | |||||
* | Apply VISIT macro. | Raymond Hettinger | 2004-07-15 | 1 | -5/+3 |
| | |||||
* | Moved SunPro warning suppression into pyport.h and out of individual | Nicholas Bastin | 2004-07-15 | 1 | -4/+0 |
| | | | | modules and objects. | ||||
* | * balance the left/right search for getitem. | Raymond Hettinger | 2004-07-09 | 1 | -15/+13 |
| | | | | | * use assertions instead of tests after internal calls that can't fail. * expand test coverage | ||||
* | Add a comment with implementation notes. | Raymond Hettinger | 2004-06-26 | 1 | -0/+7 |
| | |||||
* | Fixed end-of-loop code not reached warning when using SunPro C | Nicholas Bastin | 2004-06-17 | 1 | -0/+4 |
| | |||||
* | Make sets and deques weak referencable. | Raymond Hettinger | 2004-05-30 | 1 | -2/+8 |
| | |||||
* | Make type check work with subclasses | Raymond Hettinger | 2004-05-18 | 1 | -1/+2 |
| | |||||
* | Make sure "del d[n]" is properly supported. Was necessary because the | Raymond Hettinger | 2004-05-12 | 1 | -0/+41 |
| | | | | | | same method that implements __setitem__ also implements __delitem__. Also, there were several good use cases (removing items from a queue and implementing Forth style stack ops). | ||||
* | * Add unittests for iterators that report their length | Raymond Hettinger | 2004-04-12 | 1 | -0/+2 |
| | | | | | | * Document the differences between them * Fix corner cases covered by the unittests * Use Py_RETURN_NONE where possible for dictionaries | ||||
* | Improve deque iteration. | Raymond Hettinger | 2004-03-18 | 1 | -1/+102 |
| | | | | | | * The default __reversed__ performed badly, so reintroduced a custom reverse iterator. * Added length transparency to improve speed with map(), list(), etc. | ||||
* | Special case endpoint access for speed. | Raymond Hettinger | 2004-03-04 | 1 | -10/+18 |
| | |||||
* | Replace left(), right(), and __reversed__() with the more general purpose | Raymond Hettinger | 2004-03-01 | 1 | -123/+69 |
| | | | | | | | __getitem__() and __setitem__(). Simplifies the API, reduces the code size, adds flexibility, and makes deques work with bisect.bisect(), random.shuffle(), and random.sample(). | ||||
* | Make deque_type static so namespace is not polluted. | Neal Norwitz | 2004-02-29 | 1 | -2/+2 |
| | |||||
* | Improvements to collections.deque(): | Raymond Hettinger | 2004-02-29 | 1 | -3/+117 |
| | | | | | | | | * Add doctests for the examples in the library reference. * Add two methods, left() and right(), modeled after deques in C++ STL. * Apply the new method to asynchat.py. * Add comparison operators to make deques more substitutable for lists. * Replace the LookupErrors with IndexErrors to more closely match lists. | ||||
* | Get rid of unused variable | Neal Norwitz | 2004-02-28 | 1 | -1/+0 |
| | |||||
* | Make deque.rotate() smarter. Beef-up related tests. | Raymond Hettinger | 2004-02-08 | 1 | -4/+11 |
| | |||||
* | * Incorporate Skip's suggestions for documentation (explain the word deque | Raymond Hettinger | 2004-02-07 | 1 | -4/+44 |
| | | | | | comes from and show the differences from lists). * Add a rotate() method. | ||||
* | * Fix ref counting in extend() and extendleft(). | Raymond Hettinger | 2004-02-07 | 1 | -4/+93 |
| | | | | * Let deques support reversed(). | ||||
* | Have deques support high volume loads. | Raymond Hettinger | 2004-02-06 | 1 | -23/+74 |
| | |||||
* | Fix spelling. | Raymond Hettinger | 2004-01-29 | 1 | -2/+2 |
| |