Re: The trouble with dynamic attributes.

2010-09-20 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.: a bfoo/b bbar/b /a should a['b'] be 'foo' or 'bar'? Attribute style access would also fail in

Re: The trouble with dynamic attributes.

2010-09-19 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.: a bfoo/b bbar/b /a should a['b'] be 'foo' or 'bar'? Attribute style access would also fail in this instance -- how is this worked-around? By not

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 googler.1.webmas...@spamgourmet.com 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

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 files

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.: a bfoo/b bbar/b /a should a['b'] be 'foo' or 'bar'? Attribute style access would also fail in this instance -- how is this worked-around? -- ~Ethan~ --

Re: The trouble with dynamic attributes.

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

Re: The trouble with dynamic attributes.

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 7:46 AM, John Nagle na...@animats.com 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

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

Re: The trouble with dynamic attributes.

2010-09-16 Thread James Mills
On Fri, Sep 17, 2010 at 9:27 AM, MRAB pyt...@mrabarnett.plus.com 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

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 11:33 AM, moerchendiser2k3 googler.1.webmas...@spamgourmet.com 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

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