Guido van Rossum
f05fc716d1
Remove dead code discovered by Vladimir Marangozov.
1998-11-16 22:46:30 +00:00
Guido van Rossum
c1c7b1a699
Slight rearrangement of code in lookdict() by Vladimir Marangozov, to
...
make a common case slightly faster.
1998-10-06 16:01:14 +00:00
Guido van Rossum
0fd00334c6
Avoid using calloc(). This triggered an obscure bug on multiprocessor
...
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.)
1998-07-16 15:06:13 +00:00
Guido van Rossum
474b19e2ab
Make sure that PyDict_GetItem[String]() *never* raises an exception.
...
If the argument is not a dictionary, simply return NULL. If the
hash() on the key fails, clear the error.
1998-05-14 01:00:51 +00:00
Guido van Rossum
255443b720
Use Py_Repr{Enter,Leave} to display recursive dictionaries in finite space.
...
(Jeremy will hardly recognize his patch :-)
1998-04-10 22:47:14 +00:00
Guido van Rossum
6fcfa72c63
Correct Barry's fix -- take care of {}.get(0).
1997-10-20 20:10:00 +00:00
Barry Warsaw
320ac331d1
dict_get(): Fixed a couple of stupid mistakes which caused crashes.
...
Also got rid of some unnecessary code.
1997-10-20 17:26:25 +00:00
Barry Warsaw
c38c5da5d0
dict_get(): New method for item access with different semantics than
...
__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.
1997-10-06 17:49:20 +00:00
Guido van Rossum
4f3bf1e383
Don't intern the key string for getitem and delitem.
1997-09-29 23:31:11 +00:00
Guido van Rossum
fd7a0b871f
Made lookdict nearly twice as fast, resulting in a 5% overall
...
improvement of pystone. Vladimir Marangozov.
1997-08-18 21:52:47 +00:00
Guido van Rossum
5d8123f34a
Reordered list of methods to hopefully put the most frequently used
...
ones near the front.
1997-07-13 03:58:01 +00:00
Guido van Rossum
a8d5131d57
Renamed dict.absorb() (too spungy) to dict.update().
1997-06-02 17:13:37 +00:00
Guido van Rossum
e3f5b9c8d1
Added dict.absorb() and dict.copy().
1997-05-28 19:15:28 +00:00
Guido van Rossum
5b2121b25f
PyObject_Compare can now return an error. Unfortunately, there are a
...
few places where we don't know how to test for them without losing
speed; don't know yet how to handle that.
1997-05-23 00:01:41 +00:00
Guido van Rossum
037b2205e8
Moved PyObject_{Get,Set}Attr to object.c.
...
Fixed two 'return NULL' that should be 'return -1'.
1997-05-20 18:35:19 +00:00
Guido van Rossum
3cca24570e
Got rid of all the last_name_* bogosities. I don't think the
...
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.
1997-05-16 14:23:33 +00:00
Guido van Rossum
a9e7a81137
Renamed from mappingobject.c to dictobject.c.
...
(Sorry Jack, all your projects will have to be changed again. :-( )
1997-05-13 21:02:11 +00:00
Guido van Rossum
c0b618a2cc
Quickly renamed the last directory.
1997-05-02 03:12:38 +00:00
Guido van Rossum
3648884490
(Jack:) Align mapping entries to 4-words if USE_CACHE_ALIGNED is defined.
1997-04-11 19:14:07 +00:00
Guido van Rossum
2095d24842
Tweaks to keep the Microsoft compiler quiet.
1997-04-09 19:41:24 +00:00
Guido van Rossum
fb8f1cadb2
Add clear() method to dictionary objects.
1997-03-21 21:55:12 +00:00
Guido van Rossum
efb4609c4a
Small lookmapping nits:
...
- remove bogus initialization using uninitialized i
- derive initial incr from hash
- copy mp->ma_table into a local variable
1997-01-29 15:53:56 +00:00
Guido van Rossum
9e5656ca3f
Final three poly table entries corrected by Tim Peters.
...
Reindented the whole table.
1997-01-29 04:45:16 +00:00
Guido van Rossum
16e93a8d59
Changed the lookup algorithm again, based on Reimer Behrends's post.
...
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.
1997-01-28 00:00:11 +00:00
Guido van Rossum
ca756f2a1d
Forget keeping track of whether a dictionary contains all interned
...
string keys. Just doing a pointer compare before the string compare
(in fact before the hash compare!) is just as fast.
1997-01-23 19:39:29 +00:00