2024-04-27 04:46:52 发布
网友
我有以下函数声明:
def set_data(obj=None, name='delp', type=None):
是否有python快捷方式,其中type等于'name'值(默认为r passed),如果为None?你知道吗
常用的成语是:
def set_data(obj=None, name='delp', type=None): if type is None: type = name
(但实际上不要使用type作为变量名,它将屏蔽内置函数,如下所述:Is it safe to use the python word "type" in my code?)
type
常用的成语是:
(但实际上不要使用
type
作为变量名,它将屏蔽内置函数,如下所述:Is it safe to use the python word "type" in my code?)相关问题 更多 >
编程相关推荐