Ferrous Cranus <ni...@superhost.gr> writes: > host = gethostbyaddr(....) or "UnResolved" > > This will return the first argument that define the evaluation as > being true or untrue. > > if function returns false the the 2nd argument. > Nut if the function gives an exception will the condition return the > 2nd argument or will the program fail? > > I was udner the impression that i could avoid error handling inside > try/excepts by utilizing "or".
No, you had the wrong impression. Why don't you simply invoke the Python interpreter and try things out with that?? >>> a = 1/0 or 100 Traceback (most recent call last): File "<stdin>", line 1, in <module> ZeroDivisionError: division by zero >>> a Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'a' is not defined >>> a = 0/1 or 100 >>> a 100 >>> ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list