At Monday 4/9/2006 17:02, alf wrote:
I have a reference to certain objects. What is the most pythonic way to
test for valid reference:
By "valid reference" you mean, you have initially:
obj = None
and you want to detect whether obj is bound to another, different,
object, right?
if obj:
This checks whether obj is considered True, not whether it is None.
e.g. obj=[] would not pass.
if None!=obs:
Would be OK, but the next one is better:
if obj is not None:
This is what you are looking for! :)
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
--
http://mail.python.org/mailman/listinfo/python-list