On 2/17/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Collin Winter schrieb:
> > But Pass, Break, Continue and Ellipsis aren't in the same category as
> > Add, Mult, Div, etc.. The former stand alone
>
> That's not true. Pass, Break, Continue don't stand alone; they are
> members of the body sequence of some other statement (in particular
> for Break and Continue), you need some kind of loop around it.
>
> In any case, they are in the same category as they have no child
> nodes, which is a prerequisite for not creating objects. I can't
> see why the property "stand alone" should impact whether objects
> are created or not.

I phrased that poorly. If Pass, Break and Continue were made into
singleton instances, they wouldn't be able to be handled by the same
visitor dispatch routine as the other statement types. Taking
Demo/parser/unparse.py as an example, Unparser.dispatch would have to
change to handle Break, Pass and Continue specially from the others.
Changing the operator and context nodes to be singleton instances
involves just modifying the dispatch tables used by _BoolOp, _BinOp,
etc.

Collin Winter
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to