How about RETURN_NONE vs LOAD_CONST 0 (None); RETURN_VALUE ?

Martin v. Löwis martin at v.loewis.de
Thu Dec 12 10:15:11 EST 2002


> Apparently trying it had bad side effects & it was easier to back out?

Yes. In this specific patch, RETURN_NONE would not only return None, it
would also not call trace functions. For the case you have observed (the
implicit return at the end of the function), this is actually sensible,
since there is no source code line that corresponds to the end of the
function (the function return is traced separately also, I believe).

> >That would be safe, yes. Did you try to implement it?
> >
> Nope, are you trying to tease me into a "rich/humbling learning
experience" ? ;-)

Certainly, yes. I sincerely can't tell what the likely outcome would be:
Would you consider it not worth the pain when you are done, would you
come back with a two-line-patch, would a patch be rejected unless it
correctly determines all cases where the end of a function cannot be
reached, ...

Regards,
Martin




More information about the Python-list mailing list