On 2/11/07, <b class="gmail_sendername">Ben North</b> <<a href="mailto:ben@redfrontdoor.org">ben@redfrontdoor.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>A few days ago I posted to python-ideas with a suggestion for some new<br>Python syntax, which would allow easier access to object attributes<br>where the attribute name is known only at run-time. For example:
<br><br> setattr(self, method_name, getattr(self.metadata, method_name))<br><br>from Lib/distutils/dist.py could be rewritten<br><br> self.(method_name) = self.metadata.(method_name)<br><br>The new syntax would also be usable in augmented assignments, as in
<br><br> obj.(attr_name) += 1<br></blockquote></div><br> -1 from me. It does not solve a common problem, therefore it does not deserve a special syntax. Moreover, the existing syntax may be longer to type but is far more readable.
<br><br>-- <br>Gustavo J. A. M. Carneiro<br>"The universe is always one step beyond logic."