Hi,<br><br><div class="gmail_quote">2011/10/31 Mike Meyer <span dir="ltr"><<a href="mailto:mwm@mired.org" target="_blank">mwm@mired.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>Any attempt to mutate an object that isn't currently locked will raise<br>
an exception. Possibly ValueError, possibly a new exception class just<br>
for this purpose. This includes rebinding attributes of objects that<br>
aren't locked.</div></blockquote></div><br>PyPy offers a nice platform to play with this kind of concepts.<div>For example, even if it's not the best implementation, it's easy to add a __setattr__ to the base W_Object class, which will check whether the object is allowed to mutate.</div>

<div><br></div><div>But you certainly will open a can of worms here: even immutable objects are modified (e.g str.__hash__ is cached) and many functions that you call will need to add their own locks, is it possible to avoid deadlocks in this case?</div>

<div><br></div><div><br></div><div>-- <br>Amaury Forgeot d'Arc<br>
</div>