[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

setattr(obj, 'field1', 1)
print obj
return printed

What silly mistake am I doing now?