<div class="gmail_quote">2011/2/18 Gianluca Bargelli <span dir="ltr"><<a href="mailto:g.bargelli@gmail.com">g.bargelli@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> Potresti gentilmente fare un esempio più chiaro in merito?<br>
> In teoria sia l'unica eccezione sollevata dal built-in len() per il<br>
> codice è ErrorType:<br></div></blockquote><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">>>> class Bomba:</font></div>
</div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">... def __len__(self):</font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">... raise Exception("ESPLOSIONE TERMONUCLEARE GLOBALE")</font></div>
</div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">... </font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">>>> x = Bomba()</font></div>
</div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">>>> len(x)</font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">Traceback (most recent call last):</font></div>
</div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace"> File "<stdin>", line 1, in <module></font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace"> File "<stdin>", line 3, in __len__</font></div>
</div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">Exception: ESPLOSIONE TERMONUCLEARE GLOBALE</font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div></div></blockquote><div class="gmail_quote"><div> </div><div>:-)</div><div><br></div></div>-- <br><a href="http://thinkcode.tv/gratis">http://thinkcode.tv/gratis</a> - Capire in 15 minuti cosa può fare Python<br>
<a href="http://stacktrace.it">http://stacktrace.it</a> - Aperiodico di resistenza informatica<br><a href="http://python.thinkcode.tv">http://python.thinkcode.tv</a> - Videocorso di Python<br><a href="http://beri.it">http://beri.it</a> - Blog di una testina di vitello<br>
<br>