【发布时间】:2011-08-13 16:03:08
【问题描述】:
这不是什么大问题,但它困扰着我,所以我决定寻求灵感。
假设一个函数定义如下:
def store(book=None, author=None):
pass
当像这样调用这个函数时:
book = Book()
author = Author()
store(book=book, author=author)
我必须担心book=book 和author=author 的副作用吗?我倾向于将函数重新定义为
def store(thebook=None, theauthor=None):
pass
但这似乎有点冗长。有什么建议吗?
【问题讨论】:
标签: python function parameters naming-conventions