-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
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
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Todo