[Python-checkins] r46546 - python/trunk/Objects/dictobject.c

Tim Peters tim.peters at gmail.com
Tue May 30 07:18:49 CEST 2006


[Neal]
> I first noticed it wasn't needed when I was reviewing my own checkin.
> :-)  I fixed (removed) it.  I see you fixed another place that
> required a cast, shouldn't that really use Py_SAFE_DOWNCAST?

Not really needed, since Py_ReprEnter currently returns an int:

	register Py_ssize_t i;
	register Py_ssize_t any;

	i = Py_ReprEnter((PyObject*)mp);
	if (i != 0) {
		if (i < 0)
			return (int)i;

The value of i isn't going to stop fitting in an int just because it
gets compared to 0 ;-)

I suppose what would _really_ be clearer is declaring an additional
int variable here.  `i` just happens to be reused now, for
conceptually different purposes, in this block of code and the rest of
the routine.


More information about the Python-checkins mailing list