[BangPypers] return value

Nitin Kumar nitin.nitp at gmail.com
Mon Jun 13 17:41:51 CEST 2011


Yes,

It takes, *arg as well as**args.
I just gave an example to show the return from function behavior.

Thanks
Nitin K

On Mon, Jun 13, 2011 at 8:02 PM, Venkatraman S <venkat83 at gmail.com> wrote:

> On Mon, Jun 13, 2011 at 7:49 PM, Nitin Kumar <nitin.nitp at gmail.com> wrote:
>
> >
> > In my framework, some of function returns a Tuple.
> >
> > def fn ():
> >    return a,b
> >
> > x,y = fn()
> >
> > Going forward, I got such a situation where we need to return single
> value
> > from function. (Don't ask me to retain old behavior :) )
> >
> > Now the problem is we need to maintain backward compatibility too.
> > Is there any way we can make the function so smart that according to the
> > way
> > function is being called, it should return single value or a tuple.
> >
> >
> Does your func by any chance accept **kw (i.e, multiple arguments)?
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
Nitin K


More information about the BangPypers mailing list