2011/2/18 Gianluca Bargelli <g.barge...@gmail.com>

> > Potresti gentilmente fare un esempio più chiaro in merito?
> > In teoria sia l'unica eccezione sollevata dal built-in len() per il
> > codice è ErrorType:
>

>>> class Bomba:
...     def __len__(self):
...         raise Exception("ESPLOSIONE TERMONUCLEARE GLOBALE")
...
>>> x = Bomba()
>>> len(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __len__
Exception: ESPLOSIONE TERMONUCLEARE GLOBALE


:-)

-- 
http://thinkcode.tv/gratis - Capire in 15 minuti cosa può fare Python
http://stacktrace.it - Aperiodico di resistenza informatica
http://python.thinkcode.tv - Videocorso di Python
http://beri.it - Blog di una testina di vitello
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a