I&#39;ve started getting this error:<br clear="all"><pre class="literal-block">AttributeError: Constants can&#39;t be changed</pre>The problem is that I don&#39;t know what I&#39;m doing wrong. <br>I used Trellis to manage some computations based on an external object that contains a dictionary.<br>
In a resync method I&#39;m pushing the information inside a Trellis Dict object.<br>Everything worked fine till today when for some cases I get the above error.<br><br>How can I get more information about what my code is trying do to illegally? <br>
How can I get the name of the constant that its trying to change? <br><br>I must admit that the Trellis object where the offending method resides is a GOD object (large and tries to do way to much).<br><br>Thank you in advance.<br>
Peter<br><br><br>here is a more complete trace:<br><br>File &quot;c:\Projects\BPM\patient_display.py&quot;, line 133, in OnBiodynamic<br>&nbsp;&nbsp;&nbsp; dlg.panel.mp.resync(dlg.panel.meas)<br>&nbsp; File &quot;&lt;peak.events.trellis.wrap wrapping modules.biodynamic.measurements.resync at 0x01CC97F0&gt;&quot;, line 5, in resync<br>
&nbsp; File &quot;c:\python25\lib\site-packages\Trellis-0.6a1-py2.5.egg\peak\events\stm.py&quot;, line 466, in atomically<br>&nbsp;&nbsp;&nbsp; return super(Controller,self).atomically(self._process, func, args, kw)<br>&nbsp; File &quot;c:\python25\lib\site-packages\Trellis-0.6a1-py2.5.egg\peak\events\stm.py&quot;, line 186, in atomically<br>
&nbsp;&nbsp;&nbsp; self.cleanup(*sys.exc_info())<br>&nbsp; File &quot;c:\python25\lib\site-packages\Trellis-0.6a1-py2.5.egg\peak\events\stm.py&quot;, line 309, in cleanup<br>&nbsp;&nbsp;&nbsp; return super(Controller, self).cleanup(*args)<br>&nbsp; File &quot;c:\python25\lib\site-packages\Trellis-0.6a1-py2.5.egg\peak\events\stm.py&quot;, line 219, in cleanup<br>
&nbsp;&nbsp;&nbsp; self.rollback_to(0)<br>&nbsp; File &quot;c:\python25\lib\site-packages\Trellis-0.6a1-py2.5.egg\peak\events\stm.py&quot;, line 259, in rollback_to<br>&nbsp;&nbsp;&nbsp; f(*a)<br>&nbsp; File &quot;c:\python25\lib\site-packages\Trellis-0.6a1-py2.5.egg\peak\events\stm.py&quot;, line 141, in __new__<br>
&nbsp;&nbsp;&nbsp; subject.next_listener = self<br>&nbsp; File &quot;C:\Python25\lib\site-packages\trellis-0.6a1-py2.5.egg\peak\events\trellis.py&quot;, line 226, in __setattr__<br>&nbsp;&nbsp;&nbsp; raise AttributeError(&quot;Constants can&#39;t be changed&quot;)<br>
AttributeError: Constants can&#39;t be changed<br><br><br>and the offending code:<br><br>&nbsp;&nbsp;&nbsp; @peak.events.trellis.modifier <br>&nbsp;&nbsp;&nbsp; def resync(self, m):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m.parent = self<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print list<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for attr in self.m.keys():<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print type(m._vals[attr])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if attr in [&quot;fullness&quot;, &quot;shape&quot;, &quot;subshape&quot;, &quot;primary&quot;, &quot;pocket_placement&quot;, &quot;incision_approach&quot;,&quot;iw_adj&quot;, &quot;ih_adj&quot;, &quot;ip_adj&quot;]:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.m[attr] = m._vals[attr]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elif m._vals[attr]:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.m[attr] = m._vals[attr]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.m[attr] = m.defaults[attr]<br><br><br><br>-- <br>
There is NO FATE, we are the creators.