The trouble with "dynamic attributes".

Cameron Simpson cs at
Fri Sep 17 23:07:41 CEST 2010

On 17Sep2010 10:53, Ethan Furman <ethan at> wrote:
| Lie Ryan wrote:
| [snip]
| >And even dict-syntax is not perfect for accessing XML file, e.g.:
| >
| ><a>
| >    <b>foo</b>
| >    <b>bar</b>
| ></a>
| >
| >should a['b'] be 'foo' or 'bar'?
| Attribute style access would also fail in this instance -- how is
| this worked-around?

I'd be inclined to go for ('foo', 'bar'), though that makes all the
single occurence nodes into sequences too, a bit cumbersome:-(
Cameron Simpson <cs at> DoD#743

alt.skunks      A newsgroup for enthusiasts of skunks and other mustelidae.

More information about the Python-list mailing list