【发布时间】:2012-07-27 20:05:12
【问题描述】:
我遇到了这个——在我看来——奇怪的行为:
"a b c".split(maxsplit=1)
TypeError: split() takes no keyword arguments
为什么 str.split() 不接受关键字参数,即使它是有意义的?我在 Python2 和 Python3 中都发现了这种行为。
【问题讨论】:
-
Python 3.3:工作 ideone.com/ZMACIJ
-
Python 3.6 有效。请指定哪个版本的 Python 3.x 没有?只有 2.x (2.5 .. 2.7) 似乎表现出这一点。 Issue 1176
标签: python standard-library cpython string-split