-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Open
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Description
The docstring of list.remove()
says value
parameter as shown below:
print(help(list.remove))
# remove(self, value, /) unbound builtins.list method
# Remove first occurrence of value.
#
# Raises ValueError if the value is not present.
But the error message says x
instead of value
as shown below and I don't think list.remove(x):
is necessary:
v = ['a', 'b', 'c']
v.remove('B')
# ValueError: list.remove(x): x not in list
So, the error message should just say as shown below:
ValueError: value not in list
In addition, the docstring of bytearray.remove()
says value
parameter as shown below:
print(help(bytearray.remove))
# remove(self, value, /) unbound builtins.bytearray method
# Remove the first occurrence of a value in the bytearray.
#
# value
# The value to remove.
And, the error message reasonably says value
as shown below but I don't think found
is necessary:
v = bytearray(b'abc')
v.remove(ord('B'))
# ValueError: value not found in bytearray
So, the error message should just say as shown below:
ValueError: value not in bytearray
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Projects
Status
Todo