[Python-checkins] python/dist/src/Python ceval.c,2.327,2.328
Guido van Rossum
guido@python.org
Mon, 19 Aug 2002 16:43:38 -0400
> /* Inline the PyDict_GetItem() calls */
> PyDictObject *d;
> d = (PyDictObject *)(f->f_globals);
> x = d->ma_lookup(d, w, hash)->me_value;
> if (x != NULL) {
> Py_INCREF(x);
> PUSH(x);
> continue;
> }
>
> How about a macro here?
>
> #define PyDict_STRING_LOOKUP(D, S, HASH) \
> ((PyDictObject *)D)->ma_lookup((D), (S), (HASH))->me_value
That would only encourage more hacks like this. :-)
This is a pretty extreme measure. Maybe I'll change my mind when I
find more reasons to do this.
--Guido van Rossum (home page: http://www.python.org/~guido/)