On 2/11/07, Ben North <[EMAIL PROTECTED]> wrote:

Hi,

A few days ago I posted to python-ideas with a suggestion for some new
Python syntax, which would allow easier access to object attributes
where the attribute name is known only at run-time.  For example:

   setattr(self, method_name, getattr(self.metadata, method_name))

from Lib/distutils/dist.py could be rewritten

   self.(method_name) = self.metadata.(method_name)

The new syntax would also be usable in augmented assignments, as in

   obj.(attr_name) += 1


 -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.

--
Gustavo J. A. M. Carneiro
"The universe is always one step beyond logic."
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to