我应该在 setup.py 中使用元组还是列表作为分类器?

Should I use a tuple or list for classifiers in my setup.py?

我有两个 Python 项目。在 setup.py 中,我的分类器在方括号内:

classifiers=[
    'Development Status :: 5 - Production/Stable',
    'Natural Language :: English',
    'License :: OSI Approved :: Apache Software License',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
    'Programming Language :: Python :: 3.7',
]

另外一个,他们在括号内:

classifiers=(
    'Development Status :: 5 - Production/Stable',
    'Natural Language :: English',
    'License :: OSI Approved :: Apache Software License',
    'Programming Language :: Python',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
    'Programming Language :: Python :: 3.7',
)

我知道一个是列表,另一个是元组,我没有发现使用这两种格式有任何问题,但我想知道,使用哪种格式有关系吗?

从历史上看,将其设为元组根本不是一种选择:

虽然使用元组不再是一个彻头彻尾的错误,但当您 运行 您的设置时,您仍然会收到警告:

$ python setup.py sdist
Warning: 'classifiers' should be a list, got type 'tuple'
...

TL;DR

对分类器使用列表而不是元组。