stylistic question -- optional return value

Andrew Koenig ark at
Wed Aug 28 22:58:39 CEST 2002

Paddy> I would suggest something like (True, x, y) and (False, x, y)
Paddy> where False means disregard any y value. You could then
Paddy> consistently assign the return value of your function to three
Paddy> variables and examine the first to see if y contains useful
Paddy> data.

Hmmm... I think I like the (x, y) or (x, sentinel) idea better,
assuming that (x, y) or (x, None) isn't acceptable.

Andrew Koenig, ark at,

More information about the Python-list mailing list