471,342 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

howto resend args and kwargs to other func?

I need something like this:

def func1(*args, **kwargs):
if some_cond:
return func2(*args, **kwargs)
else:
return func3(some_other_args, **kwargs)

Thank you in advance, D.

Jul 1 '07 #1
13 1284
dmitrey <op*****@ukr.netwrote:
I need something like this:

def func1(*args, **kwargs):
if some_cond:
return func2(*args, **kwargs)
else:
return func3(some_other_args, **kwargs)

Thank you in advance, D.

You 'need something like this', so write something like that.
Did you intend to ask a question?
Jul 1 '07 #2
On Jul 1, 12:00 pm, Duncan Booth <duncan.bo...@invalid.invalidwrote:
You 'need something like this', so write something like that.
Did you intend to ask a question?
I would gladly write the one, but the example doesn't work, and I
don't know any easy way (moreover any way) to make it work correctly.
D.

Jul 1 '07 #3
dmitrey <op*****@ukr.netwrote:
On Jul 1, 12:00 pm, Duncan Booth <duncan.bo...@invalid.invalidwrote:
>You 'need something like this', so write something like that.
Did you intend to ask a question?

I would gladly write the one, but the example doesn't work, and I
don't know any easy way (moreover any way) to make it work correctly.
D.
The example doesn't work because it isn't a real example (what are
some_cond or some_other_args?). An identical example which runs but doesn't
give the output you expect would be more meaningful.

If you actually wrote a runnable example, and explained what about it you
think doesn't work, then I could probably tell you how to fix it without
having to engage my telepathy.

The only thing I can see wrong with your made-up example is that you may
have intended a * before some_other_args, but since it isn't a real example
it is probably just a typo rather than being your question.
Jul 1 '07 #4
Thanks all, I have solved the problem.
D.

Jul 1 '07 #5
dmitrey ha escrito:
Thanks all, I have solved the problem.
D.
If you take the time to comment this, it is good form to comment on
how you solved the problem, so the next one wondering about it can
find an answer before posting.

--
Saludos
Adriano

Jul 1 '07 #6
dmitrey wrote:
Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!
Jul 2 '07 #7
Frank Swarbrick a écrit :
dmitrey wrote:
>Thanks all, I have solved the problem.


Why do people do this without posting what the actual solution is!!!!
Probably because those people think usenet is a free help desk ?
Jul 2 '07 #8
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!

Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.

Nis
Jul 2 '07 #9
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!

Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.

Nis
Jul 2 '07 #10
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!

Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.

Nis
Jul 2 '07 #11
Bruno Desthuilliers skrev:
>Why do people do this without posting what the actual solution is!!!!

Probably because those people think usenet is a free help desk ?
Usenet definitely isn't a help desk. You often get useful answers from
usenet, from people who are not reading from a script.

Nis
Jul 2 '07 #12
Frank Swarbrick <in*****@earthlink.netwrote:
>dmitrey wrote:
>Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!
Hey, if we're expected to magically deduce what the problem is
without being told an error messages, surely we can magically
deduce the discovered solution too?

--
\S -- si***@chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
"Frankly I have no feelings towards penguins one way or the other"
-- Arthur C. Clarke
her nu becomež se bera eadward ofdun hlęddre heafdes bęce bump bump bump
Jul 2 '07 #13
Sion Arrowsmith <si***@chiark.greenend.org.ukwrote:
Frank Swarbrick <in*****@earthlink.netwrote:
>>dmitrey wrote:
>>Thanks all, I have solved the problem.
Why do people do this without posting what the actual solution is!!!!

Hey, if we're expected to magically deduce what the problem is
without being told an error messages, surely we can magically
deduce the discovered solution too?
Quite so. Meanwhile the OP is killfiled so can't expect any help from me in
the future.
Jul 2 '07 #14

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jim Jewett | last post: by
4 posts views Thread by Tor Rustad | last post: by
5 posts views Thread by JonathanB | last post: by
3 posts views Thread by Sean DiZazzo | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.