[Python-Dev] patch: try/finally in generators

Michael Hudson mwh@python.net
30 Jul 2002 10:33:31 +0100


Guido van Rossum <guido@python.org> writes:

> > There could be valid code out there that does not end with
> > LOAD_CONST+RETURN.
> 
> The current code generator always generates that as the final
> instruction.  But someone might add an optimizer that takes that out
> if it is provably unreachable...

The bytecodehacks has one of them :) It would probably scream and run
away if presented with a generator, but that's just a matter of
bitrot.

Cheers,
M.

-- 
  All obscurity will buy you is time enough to contract venereal
  diseases.                                  -- Tim Peters, python-dev