stylistic question -- optional return value

Frank Buss fb at
Wed Aug 28 14:14:44 EDT 2002

Andrew Koenig <ark at> wrote:

> Suppose I have a function that sometimes returns one value and sometimes
> returns two.  What's the cleanest way to define such an interface?

I'm a Python beginner, but such a function would confuse me. Perhaps you 
should write a class, but perhaps it depends on your application. Could you 
wrote more information, for which problem you need such a function?

Frank Buß, fb at,

More information about the Python-list mailing list