相关疑难解决方法(0)

为什么str.split不接受关键字参数?

在我看来,我遇到了这种奇怪的行为:

"a b c".split(maxsplit=1)
TypeError: split() takes no keyword arguments
Run Code Online (Sandbox Code Playgroud)

为什么str.split()不接受关键字参数,即使它有意义?我在Python2和Python3中都发现了这种行为.

python cpython standard-library string-split

31
推荐指数
2
解决办法
4101
查看次数

标签 统计

cpython ×1

python ×1

standard-library ×1

string-split ×1