howto resend args and kwargs to other func?

D

dmitrey

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.
 
D

Duncan Booth

dmitrey said:
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?
 
D

dmitrey

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.
 
D

Duncan Booth

dmitrey said:
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.
 
A

Adriano Varoli Piazza

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.
 
?

=?ISO-8859-1?Q?Nis_J=F8rgensen?=

Bruno Desthuilliers skrev:
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
 
?

=?ISO-8859-1?Q?Nis_J=F8rgensen?=

Bruno Desthuilliers skrev:
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
 
?

=?ISO-8859-1?Q?Nis_J=F8rgensen?=

Bruno Desthuilliers skrev:
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
 
?

=?ISO-8859-1?Q?Nis_J=F8rgensen?=

Bruno Desthuilliers skrev:
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
 
B

Bruno Desthuilliers

Frank Swarbrick a écrit :
Why do people do this without posting what the actual solution is!!!!

Probably because those people think usenet is a free help desk ?
 
S

Sion Arrowsmith

Frank Swarbrick said:
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?
 
D

Duncan Booth

Sion Arrowsmith said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top