WANG Cong wrote:

If you think setattr() is as ordinary as a trivial assignment, I will
argue with you, this is personal taste.

To my way of thinking, getattr() and setattr() are the
fundamental way of accessing attributes in Python. The
dot notation is just syntactic sugar for the overwhelmingly
common case of a static attribute name.

So the dot-notation is more "ordinary" in the sense of
being more commonly used, but not in the sense of being
a simpler operation. Both are doing exactly the same
thing underneath.

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

Reply via email to