Python 3.x 在Python中将参数从一个函数传递到另一个函数的最佳方法

Python 3.x 在Python中将参数从一个函数传递到另一个函数的最佳方法,python-3.x,function,arguments,Python 3.x,Function,Arguments,我有一个执行特定任务的函数,这个函数有很多选项,包括命名选项和未命名选项。例如: def eat_fruit(x,a_number=None , a_fruit=None): return(f'{x} ate {str(a_number)} {a_fruit}') #call the function eat_fruit("John",a_number=5,a_fruit='apples') #outputs 'John ate 5 apples' def do_l

我有一个执行特定任务的函数,这个函数有很多选项,包括命名选项和未命名选项。例如:

def eat_fruit(x,a_number=None , a_fruit=None):
    return(f'{x} ate {str(a_number)} {a_fruit}')
#call the function
eat_fruit("John",a_number=5,a_fruit='apples') #outputs 'John ate 5 apples'
def do_lots_of_stuff(a,b,activity_1=None,activity_2=None):
    return(f'''{a} and {b} {activity_1} and {activity_2}''')
do_lots_of_stuff("Bob","Mary",activity_1='run',activity_2='jump') #returns "Bob and Mary run and jump"
现在,我有了另一个函数,它包含许多选项,例如:

def eat_fruit(x,a_number=None , a_fruit=None):
    return(f'{x} ate {str(a_number)} {a_fruit}')
#call the function
eat_fruit("John",a_number=5,a_fruit='apples') #outputs 'John ate 5 apples'
def do_lots_of_stuff(a,b,activity_1=None,activity_2=None):
    return(f'''{a} and {b} {activity_1} and {activity_2}''')
do_lots_of_stuff("Bob","Mary",activity_1='run',activity_2='jump') #returns "Bob and Mary run and jump"
我想让函数
做很多东西
调用函数
吃水果
,有时带有选项。但是,我不清楚如何以直接的方式将选项从一个传递到另一个

理想情况下,我正在寻找类似于:

#This code does not work; it demos the type of functionality I am looking for.
do_lots_of_stuff("Bob","Mary",activity_1='run',activity_2='jump', eat_fruit_options={*put_options_here*}):
    eat_fruit(eat_fruit_options)
    return(f'''{a} and {b} {activity_1} and {activity_2}''')
请注意,这不能通过
do_lots_of u stuff(*do_lots_of u stuff_options*,*eat_fruit_options*)
实现,因为
eat_fruit
的选项无效。此外,关键字参数必须位于位置参数之后。此外,在这里似乎还不够,因为我只想传递一些论点,而不是全部论点

其他相关链接(尽管我不认为它们成功地解决了我的问题):

您可以传递和转发参数和关键字参数。参数采用列表的形式。关键字参数(KWARG)采用字典的形式,键为字符串,值为相关关键字值