summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
Commit message (Collapse)AuthorAgeFilesLines
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Slight performance hack that also avoids requiring the existence of threadFred Drake2000-08-311-12/+124
| | | | | | | | state for dictionaries that have only been indexed by string keys. See the comments in SourceForge for more. This closes SourceForge patch #101309.
* Clear errors raised by PyObject_Compare() without losing any existingFred Drake2000-08-311-9/+44
| | | | | | | | | | exception context. This avoids improperly propogating errors raised by a user-defined __cmp__() by a subsequent lookup operation. This patch does *not* include the performance enhancement patch for dictionaries with string keys only; that will be checked in separately. This closes SourceForge patch #101277 and bug #112558.
* Barry's patch to implement the new setdefault() method.Guido van Rossum2000-08-081-0/+36
|
* Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,Thomas Wouters2000-07-221-1/+1
| | | | | char**) and return an int even on PC platforms. If not, please fix PC/utils/makesrc.c ;-P
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-161-1/+1
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* Removed Py_PROTO and switched to ANSI C declarations in the dictTim Peters2000-07-041-104/+34
| | | | | | | implementation. This was really to test whether my new CVS+SSH setup is more usable than the old one -- and turns out it is (for whatever reason, it was impossible to do a commit before that involved more than one directory).
* Neil Schemenauer: small fixes for GCGuido van Rossum2000-07-011-0/+1
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* final patches from Neil Schemenauer for garbage collectionJeremy Hylton2000-06-301-1/+3
|
* part 2 of Neil Schemenauer's GC patches:Jeremy Hylton2000-06-231-2/+2
| | | | | | | | This patch modifies the type structures of objects that participate in GC. The object's tp_basicsize is increased when GC is enabled. GC information is prefixed to the object to maintain binary compatibility. GC objects also define the tp_flag Py_TPFLAGS_GC.
* Round 1 of Neil Schemenauer's GC patches:Jeremy Hylton2000-06-231-0/+35
| | | | | This patch adds the type methods traverse and clear necessary for GC implementation.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-4/+6
| | | | | | | | | | For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
* Add PyDict_Copy() function to C API for dicts. It returns a newJeremy Hylton2000-03-301-1/+15
| | | | dictionary that contains the same key/value pairs as p.
* Christian Tismer's "trashcan" patch:Guido van Rossum2000-03-131-0/+2
| | | | | | | | Added wrapping macros to dictobject.c, listobject.c, tupleobject.c, frameobject.c, traceback.c that safely prevends core dumps on stack overflow. Macros and functions in object.c, object.h. The method is an "elevator destructor" that turns cascading deletes into tail recursive behavior when some limit is hit.
* dict_has_key(): Accept only one parameter. PR#210 reported byFred Drake2000-02-231-4/+4
| | | | Andreas Jung <ajung@sz-sb.de>.
* Vladimir Marangozov contributed updated comments.Guido van Rossum1999-03-241-11/+8
|
* Remove dead code discovered by Vladimir Marangozov.Guido van Rossum1998-11-161-4/+2
|
* Slight rearrangement of code in lookdict() by Vladimir Marangozov, toGuido van Rossum1998-10-061-4/+3
| | | | make a common case slightly faster.
* Avoid using calloc(). This triggered an obscure bug on multiprocessorGuido van Rossum1998-07-161-1/+2
| | | | | | | Sparc Solaris 2.6 (fully patched!) that I don't want to dig into, but which I suspect is a bug in the multithreaded malloc library that only shows up when run on a multiprocessor. (The program wasn't using threads, it was just using the multithreaded C library.)
* Make sure that PyDict_GetItem[String]() *never* raises an exception.Guido van Rossum1998-05-141-2/+3
| | | | | If the argument is not a dictionary, simply return NULL. If the hash() on the key fails, clear the error.
* Use Py_Repr{Enter,Leave} to display recursive dictionaries in finite space.Guido van Rossum1998-04-101-5/+31
| | | | (Jeremy will hardly recognize his patch :-)
* Correct Barry's fix -- take care of {}.get(0).Guido van Rossum1997-10-201-0/+3
|
* dict_get(): Fixed a couple of stupid mistakes which caused crashes.Barry Warsaw1997-10-201-8/+2
| | | | Also got rid of some unnecessary code.
* dict_get(): New method for item access with different semantics thanBarry Warsaw1997-10-061-0/+38
| | | | | | | | | __getitem__(). This method never raises an exception; if the key is not in the dictionary, the second (optional) argument is returned. If the second argument is not provided and the key is missing, None is returned. mapp_methods: added "get" method.
* Don't intern the key string for getitem and delitem.Guido van Rossum1997-09-291-3/+1
|
* Made lookdict nearly twice as fast, resulting in a 5% overallGuido van Rossum1997-08-181-11/+13
| | | | improvement of pystone. Vladimir Marangozov.
* Reordered list of methods to hopefully put the most frequently usedGuido van Rossum1997-07-131-4/+4
| | | | ones near the front.
* Renamed dict.absorb() (too spungy) to dict.update().Guido van Rossum1997-06-021-3/+3
|
* Added dict.absorb() and dict.copy().Guido van Rossum1997-05-281-6/+70
|
* PyObject_Compare can now return an error. Unfortunately, there are aGuido van Rossum1997-05-231-0/+8
| | | | | few places where we don't know how to test for them without losing speed; don't know yet how to handle that.
* Moved PyObject_{Get,Set}Attr to object.c.Guido van Rossum1997-05-201-33/+2
| | | | Fixed two 'return NULL' that should be 'return -1'.
* Got rid of all the last_name_* bogosities. I don't think theGuido van Rossum1997-05-161-53/+34
| | | | | | | complexity saved much any more. A simple benchmark (grail) showed that there were 3 times as many misses as hits, and the same number of times again the code was bypassed altogether due to the existence of setattro/getattro.
* Renamed from mappingobject.c to dictobject.c.Guido van Rossum1997-05-131-110/+104
| | | | (Sorry Jack, all your projects will have to be changed again. :-( )
* Quickly renamed the last directory.Guido van Rossum1997-05-021-255/+258
|
* (Jack:) Align mapping entries to 4-words if USE_CACHE_ALIGNED is defined.Guido van Rossum1997-04-111-0/+3
|
* Tweaks to keep the Microsoft compiler quiet.Guido van Rossum1997-04-091-1/+1
|
* Add clear() method to dictionary objects.Guido van Rossum1997-03-211-0/+13
|
* Small lookmapping nits:Guido van Rossum1997-01-291-5/+6
| | | | | | - remove bogus initialization using uninitialized i - derive initial incr from hash - copy mp->ma_table into a local variable
* Final three poly table entries corrected by Tim Peters.Guido van Rossum1997-01-291-31/+30
| | | | Reindented the whole table.
* Changed the lookup algorithm again, based on Reimer Behrends's post.Guido van Rossum1997-01-281-114/+101
| | | | | | | | | The table size is now constrained to be a power of two, and we use a variable increment based on GF(2^n)-{0} (not that I have the faintest idea what that is :-) which helps avoid the expensive '%' operation. Some of the entries in the table of polynomials have been modified according to a post by Tim Peters.
* Forget keeping track of whether a dictionary contains all internedGuido van Rossum1997-01-231-89/+55
| | | | | string keys. Just doing a pointer compare before the string compare (in fact before the hash compare!) is just as fast.
* String interning.Guido van Rossum1997-01-181-16/+105
|
* Rewrote lookmapping() according to suggestions by Jyrki Alakuijala.Guido van Rossum1997-01-161-21/+71
|
* Experimental new implementation of dictionary comparison. ThisGuido van Rossum1996-12-051-0/+63
| | | | | | | defines that a shorter dictionary is always smaller than a longer one. For dictionaries of the same size, the smallest differing element determines the outcome (which yields the same results as before, without explicit sorting).
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Support for tp_getattro, tp_setattro (Sjoerd)Guido van Rossum1996-08-091-0/+6
|
* Speedup suggested by SjoerdGuido van Rossum1996-07-301-3/+4
|
* fix free memory reads in dictlookup et alGuido van Rossum1995-12-081-10/+7
|