summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
Commit message (Collapse)AuthorAgeFilesLines
* The tracking statistics were actually too pessimisticAntoine Pitrou2009-03-231-0/+1
|
* Issue #4688: Add a heuristic so that tuples and dicts containing onlyAntoine Pitrou2009-03-231-1/+81
| | | | | | | | | untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes. (trivia: this makes the "binary_trees" benchmark from the Computer Language Shootout 40% faster)
* Issue #3680: Reference cycles created through a dict, set or deque iterator ↵Antoine Pitrou2009-01-011-8/+17
| | | | did not get collected.
* Punctuation fix; expand dict.update docstring to be clearerAndrew M. Kuchling2008-10-041-4/+6
|
* - Issue #3537: Fix an assertion failure when an empty but presized dictGeorg Brandl2008-08-111-0/+4
| | | | object was stored in the freelist.
* Issue 2235: __hash__ is once again inherited by default, but inheritance can ↵Nick Coghlan2008-07-151-1/+1
| | | | be blocked explicitly so that collections.Hashable remains meaningful
* Issue 3230: Do not the set specific size macro.Raymond Hettinger2008-06-281-1/+1
|
* Corrected inconsistencies in sizeof tests and addressed issue pointedRobert Schuppenies2008-06-261-1/+1
| | | | out by Jean Brouwers.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-39/+39
| | | | | | | 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.
* Some style nits. Also clarify in the docstrings what __sizeof__ does.Georg Brandl2008-06-011-1/+1
|
* Issue #2898: Added sys.getsizeof() to retrieve size of objects in bytes.Robert Schuppenies2008-06-011-0/+15
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-39/+39
|
* A little reformating of Py3k warningsBenjamin Peterson2008-04-271-2/+2
|
* Use PyErr_WarnPy3k throughoutBenjamin Peterson2008-04-271-8/+4
|
* Fix tabs.Georg Brandl2008-03-251-1/+1
|
* Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl2008-03-251-3/+6
| | | | EOL 80 limit and supply more alternatives in warning messages.
* Add py3k warnings for object, type, cell and dict comparisons. This should ↵Steven Bethard2008-03-181-1/+7
| | | | resolve issue2342 and partly resolve issue2373.
* Use PY_FORMAT_SIZE_T instead of z for string formatting. Thanks Neal.Christian Heimes2008-02-241-2/+4
|
* dict.copy() rises from the ashes. Revert r60687.Raymond Hettinger2008-02-121-4/+0
|
* Add -3 warnings that set.copy(), dict.copy(), and defaultdict.copy() will go ↵Raymond Hettinger2008-02-091-0/+4
| | | | away in Py3.x
* Use prefix decrementChristian Heimes2008-02-081-2/+2
|
* Deallocate content of the dict free list on interpreter shutdownChristian Heimes2008-02-081-0/+12
|
* Added some statistics code to dict and list object code. I wanted to test ↵Christian Heimes2008-02-071-0/+25
| | | | 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.
* Unified naming convention for free lists and their limits. All free listsChristian Heimes2008-02-061-7/+9
| | | | | | | | 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.
* Changes 54857 and 54840 broke code and were reverted in Py2.5 just beforeRaymond Hettinger2008-01-251-1/+1
| | | | it was released, but that reversion never made it to the Py2.6 head.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-4/+4
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Give meaning to the oparg for BUILD_MAP: estimated size of the dictionary.Raymond Hettinger2007-12-181-0/+17
| | | | | | | | | | | Allows dictionaries to be pre-sized (upto 255 elements) saving time lost to re-sizes with their attendant mallocs and re-insertions. Has zero effect on small dictionaries (5 elements or fewer), a slight benefit for dicts upto 22 elements (because they had to resize once anyway), and more benefit for dicts upto 255 elements (saving multiple resizes during the build-up and reducing the number of collisions on the first insertions). Beyond 255 elements, there is no addional benefit.
* Spaces vs. Tabs.Georg Brandl2007-11-291-4/+4
|
* Fix bug #1517, a segfault in lookdict().Guido van Rossum2007-11-291-0/+4
|
* Backport of _abccoll.py by Benjamin Arangueren, issue 1383.Guido van Rossum2007-11-221-8/+1
| | | | With some changes of my own thrown in (e.g. backport of r58107).
* Optimize common case for dict.fromkeys().Raymond Hettinger2007-11-091-10/+15
|
* Optimize dict.fromkeys() with dict inputs. Useful for resetting bag/muliset ↵Raymond Hettinger2007-11-071-0/+19
| | | | counts for example.
* Remove file-level typedefs that were inconsistently used throughout the file.Brett Cannon2007-10-101-105/+103
| | | | | | Just move over to the public API names. Closes issue1238.
* Add a bunch of GIL release/acquire points in tp_print implementations and forBrett Cannon2007-09-171-1/+12
| | | | | | PyObject_Print(). Closes issue #1164.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-12/+8
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Whitespace cleanupNeal Norwitz2007-05-231-1/+1
|
* Add -3 option to the interpreter to warn about features that areNeal Norwitz2007-05-231-2/+12
| | | | | | | deprecated and will be changed/removed in Python 3.0. This patch is mostly from Anthony. I tweaked some format and added a little doc.
* Add test and fix for fromkeys() optional argument.Raymond Hettinger2007-03-211-2/+2
|
* Extend work on rev 52962 and 53829 eliminating redundant PyObject_Hash() ↵Raymond Hettinger2007-03-201-0/+18
| | | | calls and fixing set/dict interoperability.
* Variation of patch # 1624059 to speed up checking if an object is a subclassNeal Norwitz2007-02-251-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().Raymond Hettinger2007-02-191-0/+39
|
* SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclassesRaymond Hettinger2007-02-071-1/+1
|
* Fix refleakNeal Norwitz2006-10-291-0/+1
|
* Bug #1576657: when setting a KeyError for a tuple key, make sure thatGeorg Brandl2006-10-291-3/+16
| | | | the tuple isn't used as the "exception arguments tuple".
* Fix warnings with HP's C compiler. It doesn't recognize that infiniteNeal Norwitz2006-10-281-0/+4
| | | | | | loops are, um, infinite. These conditions should not be able to happen. Will backport.
* Fix SF bug #1546288, crash in dict_equal.Neal Norwitz2006-09-051-0/+3
|
* Typo fixesAndrew M. Kuchling2006-08-041-1/+1
|
* Add some asserts that we got good params passedNeal Norwitz2006-07-211-0/+3
|
* SF bug #1503294.Armin Rigo2006-06-101-1/+1
| | | | PyThreadState_GET() complains if the tstate is NULL, but only in debug mode.
* Armin committed his patch while I was reviewing it (I'm sureTim Peters2006-06-011-28/+40
| | | | | | | | he didn't know this), so merged in some changes I made during review. Nothing material apart from changing a new `mask` local from int to Py_ssize_t. Mostly this is repairing comments that were made incorrect, and adding new comments. Also a few minor code rewrites for clarity or helpful succinctness.