python检查模块位置参数

python检查模块位置参数,python,inspect,Python,Inspect,值必须作为位置参数提供 Python没有用于定义仅位置参数的显式语法, 但是许多内置和扩展模块功能(尤其是那些 仅接受一个或两个参数)接受它们 有人能给我举一个只有位置的论点的例子吗 >>> print str.split.__doc__ S.split([sep [,maxsplit]]) -> list of strings Return a list of the words in the string S, using sep as the delimiter

值必须作为位置参数提供

Python没有用于定义仅位置参数的显式语法, 但是许多内置和扩展模块功能(尤其是那些 仅接受一个或两个参数)接受它们

有人能给我举一个只有位置的论点的例子吗

>>> print str.split.__doc__
S.split([sep [,maxsplit]]) -> list of strings

Return a list of the words in the string S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator and empty strings are removed
from the result.
此处
str.split
有一个仅位置参数的示例:

>>> s = 'hello world'
>>> s.split(' ', maxsplit=1)
TypeError: split() takes no keyword arguments
>>> s.split(' ', 1)
['hello', 'world']