On 7/1/10 8:02 AM, WANG Cong wrote:
On 06/27/10 09:06, Steven D'Aprano<st...@remove-this-cybersource.com.au>  wrote:

In that situation, certainly: adding an attribute on the fly to that
formal definition seems entirely strange and special of an activity. But
that's only because you *chose* to *see* and *use* the object that way.
The "special"ness of the activity is entirely in your head, and to
Python, its an entirely normal event.

Exactly. Things which other languages make scary and mysterious
"metaprogramming" are, in Python, normal and ordinary programming. It
doesn't seem to do us any harm.


As long as setattr() exists in Python, that will be not so ordinary. :)

setattr is perfectly ordinary.

--

   ... Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to