stylistic question -- optional return value

Frank Buss fb at frank-buss.de
Wed Aug 28 20:14:44 CEST 2002


Andrew Koenig <ark at research.att.com> 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 frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de



More information about the Python-list mailing list