Re: The trouble with "dynamic attributes".

2010-09-19 Thread Steven D'Aprano
On Sun, 19 Sep 2010 16:47:26 +1000, Lie Ryan wrote: > On 09/18/10 03:53, Ethan Furman wrote: >> Lie Ryan wrote: >> [snip] >>> And even dict-syntax is not perfect for accessing XML file, e.g.: >>> >>> >>> foo >>> bar >>> >>> >>> should a['b'] be 'foo' or 'bar'? >> >> Attribute style acce

Re: The trouble with "dynamic attributes".

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

Re: The trouble with "dynamic attributes".

2010-09-18 Thread Jorgen Grahn
On Fri, 2010-09-17, James Mills wrote: > On Fri, Sep 17, 2010 at 11:33 AM, moerchendiser2k3 > wrote: >> I am really sorry, but what are you talking about ? Hmmm, ...I have >> problems to compile Python on SL, I did not ask anything about >> "dynamic attribute". I don't get it... > > You are subscr

Re: The trouble with "dynamic attributes".

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

Re: The trouble with "dynamic attributes".

2010-09-17 Thread Ethan Furman
Lie Ryan wrote: [snip] And even dict-syntax is not perfect for accessing XML file, e.g.: foo bar should a['b'] be 'foo' or 'bar'? Attribute style access would also fail in this instance -- how is this worked-around? -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-lis

Re: The trouble with "dynamic attributes".

2010-09-17 Thread Lie Ryan
On 09/17/10 07:46, John Nagle wrote: >There's a tendency to use "dynamic attributes" in Python when > trying to encapsulate objects from other systems. It almost > works. But it's usually a headache in the end, and should be > discouraged. Here's why. I personally love them, they makes XML

Re: The trouble with "dynamic attributes".

2010-09-16 Thread Terry Reedy
On 9/16/2010 5:46 PM, John Nagle wrote: By mistakenly posted this as a response to "compile Py2.6 on SL", you 1) confused the OP and 2) limited it audience -- I agree with your points, but would have missed this if I had had threads collapsed, as I usually do, since I have no interest in 2.6 co

Re: The trouble with "dynamic attributes".

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 11:33 AM, moerchendiser2k3 wrote: > I am really sorry, but what are you talking about ? Hmmm, ...I have > problems to compile Python on SL, I did not ask anything about > "dynamic attribute". I don't get it... You are subscribed to the python mailing list. Check your subs

Re: The trouble with "dynamic attributes".

2010-09-16 Thread moerchendiser2k3
I am really sorry, but what are you talking about ? Hmmm, ...I have problems to compile Python on SL, I did not ask anything about "dynamic attribute". I don't get it... -- http://mail.python.org/mailman/listinfo/python-list

Re: The trouble with "dynamic attributes".

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 9:27 AM, MRAB wrote: > For the work on updating the re module there was a discussion about > whether named capture groups should be available as attributes of the > match object or via subscripting (or both?). Subscripting seemed > preferable to me because: > > 1. Adding at

Re: The trouble with "dynamic attributes".

2010-09-16 Thread MRAB
On 16/09/2010 22:46, John Nagle wrote: There's a tendency to use "dynamic attributes" in Python when trying to encapsulate objects from other systems. It almost works. But it's usually a headache in the end, and should be discouraged. Here's why. Some parsers, like BeautifulSoup, try to encaps

Re: The trouble with "dynamic attributes".

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 7:46 AM, John Nagle wrote: > There's a tendency to use "dynamic attributes" in Python when > trying to encapsulate objects from other systems.  It almost > works.  But it's usually a headache in the end, and should be > discouraged.  Here's why. What do you mean by "dynam

The trouble with "dynamic attributes".

2010-09-16 Thread John Nagle
There's a tendency to use "dynamic attributes" in Python when trying to encapsulate objects from other systems. It almost works. But it's usually a headache in the end, and should be discouraged. Here's why. Some parsers, like BeautifulSoup, try to encapsulate HTML tag fields as Python a