473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1345
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Achim Domma | last post by:
Hi, I'm using py2exe to create a exe out of a python script. If works fine so far, but a get lot's of this warnings: warning: use func(*args, **kwargs) instead of apply(func, args, kwargs) ...
2
by: Jim Jewett | last post by:
Normally, I expect a subclass to act in a manner consistent with its Base classes. In particular, I don't expect to *lose* any functionality, unless that was the whole point of the subclass. ...
15
by: Stefan Behnel | last post by:
Hi! I'm trying to do this in Py2.4b1: ------------------------------- import logging values = {'test':'bla'} logging.log(logging.FATAL, 'Test is %(test)s', values)...
4
by: Tor Rustad | last post by:
I have a C program, where I control the error behavior according to context: /* some error handlers */ static void on_error_log (MYSQL *mysql, const char *msg, ...); .... static void...
3
by: dmitrey | last post by:
hi all, howto check is object Arg1 - a func, lambda-func - something else? I tried callable(Arg1), but callable(lambda-func) returnes False Thx, D.
7
by: dmitrey | last post by:
hi all, can anyone explain howto get function from module, known by string names? I.e. something like def myfunc(module_string1, func_string2, *args): eval('from ' + module_string1 + 'import...
5
by: JonathanB | last post by:
Ok, this is probably definitely a newbie question, but I have looked all over the Python library reference material and tutorials which I can find online and I cannot find a clear definition of...
3
by: Sean DiZazzo | last post by:
Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? ~~~~~~~~~~~~~~~~ server.py import SocketServer from SimpleXMLRPCServer import...
1
by: dmitrey | last post by:
hi all, howto check is function capable of obtaining **kwargs? i.e. I have some funcs like def myfunc(a,b,c,...):... some like def myfunc(a,b,c,...,*args):... some like
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.