[Zope] error with setattr
Fernando Martins
fmartins@hetnet.nl
Sun, 2 Mar 2003 17:55:29 +0100
> Andreas Jung wrote:
> setattr(obj, key, value).
Ah! it's not a method. Somehow I thought obj meant self...
Now, I'm getting the error:
Error Type: TypeError
Error Value: attribute-less object (assign or del)
which is correct in the original version, but after adding a dummy field I
still get the error.
_____________________
class Record:
field0 = 0
obj=Record()
setattr(obj, 'field1', 1)
print obj
return printed
______________________
What silly mistake am I doing now?
Thanks,
Fernando