88 Commits

Author SHA1 Message Date
Benjamin Peterson
630329e4ea merge 3.3 2016-01-01 11:55:47 -06:00
Benjamin Peterson
0e617e22f0 remove some copyright notices supserseded by the toplevel ones 2016-01-01 11:53:47 -06:00
Raymond Hettinger
239aba7874 Issue #19663: Improve error message for defaultdict. 2015-07-20 03:09:22 -04:00
Raymond Hettinger
c6249a6268 Defer deleted item decref until after the deque is restored to a consistent state. 2015-05-02 10:44:17 -07:00
Benjamin Peterson
e19d9d1467 merge 3.3 (#20250) 2014-01-13 23:56:30 -05:00
Benjamin Peterson
9cb33b7d03 correct defaultdict signature in docstring (closes #20250)
Patch from Andrew Barnert.
2014-01-13 23:56:05 -05:00
Victor Stinner
e7f516cbb8 Issue #19512: _count_elements() of _collections reuses PyId_get identifier
instead of literal "get" string
2013-11-06 23:52:55 +01:00
Raymond Hettinger
07573d7b24 merge 2013-10-04 16:52:39 -07:00
Raymond Hettinger
cb1d96f782 Issue #18594: Make the C code more closely match the pure python code. 2013-10-04 16:51:02 -07:00
Raymond Hettinger
75f65e368e merge 2013-10-01 21:38:37 -07:00
Raymond Hettinger
224c87d60c Issue #18594: Fix the fallback path in collections.Counter(). 2013-10-01 21:36:09 -07:00
Raymond Hettinger
c13516b0a0 merge 2013-10-01 01:00:59 -07:00
Raymond Hettinger
2ff2190b62 Issue #18594: Fix the fast path for collections.Counter().
The path wasn't being taken due to an over-restrictive type check.
2013-10-01 00:55:43 -07:00
Raymond Hettinger
77578204d6 Restore the data block size to 62.
The former block size traded away good fit within cache lines in
order to gain faster division in deque_item().  However, compilers
are getting smarter and can now replace the slow division operation
with a fast integer multiply and right shift.  Accordingly, it makes
sense to go back to a size that lets blocks neatly fill entire
cache-lines.

GCC-4.8 and CLANG 4.0 both compute "x // 62" with something
roughly equivalent to "x * 9520900167075897609 >> 69".
2013-07-28 02:39:49 -07:00
Raymond Hettinger
3223dd5c22 Assertions key off NDEBUG 2013-07-26 23:14:22 -07:00
Raymond Hettinger
b97cc49c3a Minor code simplification by eliminating an unnecessary temporary variable. 2013-07-21 01:51:07 -07:00
Raymond Hettinger
90dea4ce43 Tweak the deque struct by moving the least used fields (maxlen and weakref) to the end. 2013-07-13 22:30:25 -07:00
Raymond Hettinger
840533bf1c Use a do-while loop in the inner loop for rotate (m is always greater than zero). 2013-07-13 17:03:58 -07:00
Raymond Hettinger
3959af9b2a Move the freeblock() call outside the main loop to speed-up and simplify the block re-use logic. 2013-07-13 02:34:08 -07:00
Raymond Hettinger
d9c116ca40 Add a spacing saving heuristic to deque's extend methods 2013-07-09 00:13:21 -07:00
Raymond Hettinger
b385529ddf Fix #ifdef 2013-07-07 02:07:23 -10:00
Raymond Hettinger
82df925451 Use macros for marking and checking endpoints in the doubly-linked list of blocks.
* Add comment explaining the endpoint checks
* Only do the checks in a debug build
* Simplify newblock() to only require a length argument
  and leave the link updates to the calling code.
* Also add comment for the freelisting logic.
2013-07-07 01:43:42 -10:00
Raymond Hettinger
f3a67b7e57 Improve variable names in deque_count() 2013-07-06 17:49:06 -10:00
Raymond Hettinger
df715ba54d Apply the PyObject_VAR_HEAD and Py_SIZE macros
to be consistent with practices in other modules.
2013-07-06 13:01:13 -10:00
Raymond Hettinger
5bfa8671bc Refactor deque_traverse().
Hoist conditional expression out of the loop.
Use rightblock as the guard instead of checking for NULL.
2013-07-06 11:58:09 -10:00