Proposal for new operators to python that add syntactic sugar for hierarcical data.

glomde tbrkic at yahoo.com
Thu May 18 15:27:42 EDT 2006


> We already have this (quite close to) this syntax:
>
> class <name>(super):
>  <name>=<attr_value> *
>  [class *]
>
> There's also the Zope3 'implements' trick, that allow to modify the
> class namespace without assignement:
>
> class <name>:
>   <callable>(*args, **kw)*
>
> So what you want is very certainly doable without any syntax change.

It's not obvious me how you would do it it with the above syntax.
Could you give me an example?
For example how would you do:

root = ET.Element("html")
  node root:
     attr head("head"):
         node title("title):
         for i in sections:
              node section():
                   attr Text = section[i]




More information about the Python-list mailing list