[pypy-dev] Unpacking sequence

Armin Rigo arigo at tunes.org
Sat Oct 11 20:18:53 CEST 2003


Hello Seo,

On Sun, Oct 12, 2003 at 02:42:54AM +0900, Seo Sanghyeon wrote:
> def boom():
>     a, b = 0, 1

Ah. The issue is a bit complicated by the fact that we currently don't handle
exception. There is an exception hidden there because we also don't remember
that (0, 1) is actually a tuple of two elements, so it could be the case that
there is the wrong number of values to unpack.

I guess that besides remining us that we haven't exceptions yet, it shows us 
that we need to be a bit more subtle even in the control flow analysis and not 
only remember either "it's a variable" or "it's a constant".

The same problem will appear for try: finally: blocks, for example, where we
might want to remember that the saved stack unrolled is "either a
StopUnrolling or a SApplicationException instance". In other words some kind
of type analysis is still needed in the control flow. Hopefully, however, we
can avoid the former problems of AnnObjSpace by only considering immutable
objects.


Armin



More information about the Pypy-dev mailing list