Hi all,

Suppose we have

class A(object):
    pass

a = A()

Is there any difference between

setattr(a, 'foo', 'bar)

and

a.__setattr__['foo'] = 'bar'

other than syntax?

And which is considered 'better' form in Python?

Cheers,

Rasjid.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to