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

Bengt Richter bokr at oz.net
Thu Dec 12 02:56:28 EST 2002


On 12 Dec 2002 07:51:53 +0100, martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) wrote:

>bokr at oz.net (Bengt Richter) writes:
>
>> The boilerplate always returns None, so why not minimize the boilerplate
>> to one byte code? 
>
>See python.org/sf/587993. RETURN_NONE was implemented, then taken out
>again. Ask Google for RETURN_NONE, there are plenty of prior
>discussions.
Apparently trying it had bad side effects & it was easier to back out?
>
>> E.g., when would it be unsafe to eliminate it if the last statement
>> in the function is a return at indent level 1 ?
>
>That would be safe, yes. Did you try to implement it?
>
Nope, are you trying to tease me into a "rich/humbling learning experience" ? ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list