updated pre-PEP: The create statement
Steven Bethard
steven.bethard at gmail.com
Mon Apr 10 22:43:19 EDT 2006
Azolex wrote:
> Steven Bethard wrote:
>> and named, nested hierarchies like XML documents could be created
>> like::
>>
>> create ETobject html:
>> "This statement would generate an ElementTree object"
>>
>> create ETobject head:
>> "generate the head"
>> ...
>>
>> create ETobject body:
>> "generate the body"
>> ...
>
> I think this is is a most important eventual use-case, and would like to
> see it better worked out - or else declared outside the scope of the
> proposed statement. As far as I can see, this does not cut it, since xml
> and html allow /sequencial repetition/ of tags and the results of the
> statement suites are passed as unordered namespaces/dicts.
Good point. The code above would only work if you didn't care about the
order of elements. I'm half inclined to pull the example, but the
original was due to Michele Simionato, and I haven't quite convinced
myself yet that you couldn't hack it to have ETObject append to an
internal list somehow to keep order. Michele? Did you have a plan for
how this would work?
STeVe
More information about the Python-list
mailing list