[Zope-dev] proxydict problems in 2.8b2 with Localizer

Lennart Regebro regebro at gmail.com
Mon May 23 14:41:48 EDT 2005


On 5/23/05, Dieter Maurer <dieter at handshake.de> wrote:
> Lennart Regebro wrote at 2005-5-23 13:29 +0200:
> >I get "TypeError: object does not support item assignment" in  lin 46
> >och class_init.py.
> >
> >The offending code is "d['_implicit__name__'] = 1" and this is because
> >d is a proxydict. This in turn is caused by Localizer having a class
> >as a class attribute:
> 
> At other places, a similar problem could be solved by
> "setattr(class, attr, value)" instead of "class.__dict__[attr] = value".

I also succeeded in working around the problem by setting
__name__ and _needs_name__ on the attribute in question, which feels
better than my previous workaround.

-- 
Lennart Regebro, Nuxeo     http://www.nuxeo.com/
CPS Content Management     http://www.cps-project.org/


More information about the Zope-Dev mailing list