Python dynamic attribute creation
WANG Cong
xiyou.wangcong at gmail.com
Thu Jul 1 10:13:29 EDT 2010
On 06/30/10 01:25, Ethan Furman <ethan at stoneleaf.us> wrote:
>> But if so why setattr() still exists? What is it for if we can do the
>> same thing via assignments? Also, in order to be perfect, Python should
>> accept to add dynamic attributes dynamically, something like PEP
>> 363. That doesn't happen.
>
> Setattr and friends exist to work with dynamic attributes.
>
Yeah, my point is why setattr() for dynamic attributes while assignments
for static attributes? Why not unify them?
> "The Perfect Language" does not exist, and never will. I'm not even
> sure it could exist for a single person, let alone a group of people
> with disparate needs, patterns of thought, etc.
>
Agreed, but at least, the reason why I am being against so many people
here is also trying to make Python be more perfect with my
understanding.
Thanks!
--
Live like a child, think like the god.
More information about the Python-list
mailing list