Hello, can you please file a bug report about this inconsistency: for list None is not allowed in the index method, while for str it is. Also there are 2 different formats for optional paremeters in the help.
''.index('', 0, None) 97: 0 [].index('', 0, None) Traceback (most recent call last): File "<pyshell#169>", line 1, in <module> [].index('', 0, None) TypeError: slice indices must be integers or None or have an __index__ method help(''.index) Help on built-in function index:
index(...) S.index(sub[, start[, end]]) -> int Like S.find() but raise ValueError when the substring is not found.
help([].index) Help on built-in function index:
index(...) L.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present.
participants (1)
-
sdfjsfjaei-thomas@yahoo.de