Re: Python: "dynamische" Klassenvariablen?

"Jens W. Klein" <[email protected]>
Newsgroups gmane.comp.web.zope.german
Organization Klein & Partner KEG, BlueDynamics Alliance
Message-ID <1265275404.4663.36.camel@minime>
Am Donnerstag, den 04.02.2010, 10:09 +0100 schrieb Peter Zechmeister:
> > warum nicht danach überhaupt nur:
> > 
> > TestClass[name] = PageTemplateFile(filepath)
> 
> OK. Ich geb mir die Antwort selbst: Weil es nicht geht.
> 
> >>> class A():
> ...  pass
> ... 
> >>> A.a=1
> >>> A['b']=2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: 'classobj' object does not support item assignment
> >>> 

Ah, dacht ich mir schon und wunderte mich das es geht. Nach dem Motto,
die Wege des Zope2 sind unergründlich :-) na dann.

lg Jens



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.