Il 18 febbraio 2011 16:13, Gianluca Bargelli <g.barge...@gmail.com> ha scritto: > Il 18 febbraio 2011 13:28, Enrico Franchi <enrico.fran...@gmail.com> ha > scritto: >> Gianluca Bargelli wrote: >>> >>> ... except TypeError: >>> ... len(str(item)) >>> >> >> Non mi e' chiaro questo gestore di eccezioni, pero'... :) >> Ovvero, e' equivalente ad un pass nella maggior parte dei casi [0]. > > Potresti gentilmente fare un esempio più chiaro in merito? > In teoria sia l'unica eccezione sollevata dal built-in len() per il > codice è ErrorType: > > "Raised when an operation or function is applied to an object of > inappropriate type. The associated value is a string giving details > about the type mismatch." [1]
Dimenticavo: [1]: http://docs.python.org/library/exceptions.html?highlight=typeerror#exceptions.TypeError >> ---- >> [0] formalmente no, poiche' str(item) potrebbe fare di tutto, lanciare >> un'eccezione, scatenare una guerra termonucleare globale, evocare un balor. >> > > :D > -- > -Gianluca > http://proudlygeek.appspot.com > -- -Gianluca http://proudlygeek.appspot.com _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python