Re: Python: "dynamische" Klassenvariablen?

Peter Zechmeister <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <1265274591.7593.36.camel@pze>
> 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
>>>



_______________________________________________
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.