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

Michael Hudson mwh at python.net
Thu Dec 12 06:24:16 EST 2002


bokr at oz.net (Bengt Richter) writes:

> 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?

No, it just turned out not to be necessary.

I don't think saving one byte per code object is much of a gain, nor
is there going to be much of a performance benefit -- LOAD_CONST is
pretty quick.

Cheers,
M.

-- 
  SCSI is not magic. There are fundamental technical reasons why it
  is necessary to sacrifice a young goat to your SCSI chain now and
  then.                                                  -- John Woods



More information about the Python-list mailing list