On 10/10/17 11:00 AM, Stefan Ram wrote:
xieyuheng <xyh...@gmail.com> writes:
1. 'setattr(o, name, value)' can be used for what kind of objects ?
It takes three objects as arguments.
The first object should have an attribute named by the value
of »name« that should allow this attribute to be set to
»value« as if by
o.<name>=value
where <name> is the value of »name« (which should be a string).
One tweak to this: the object doesn't need to have the attribute
initially. setattr() can create new attributes that don't already exist.
--Ned.
--
https://mail.python.org/mailman/listinfo/python-list