Bug report
Bug description:
# The help() output for str.count lacks the '/' for positional-only arguments
help(str.count)
# Relevant output line:
# count(...) unbound builtins.str method
# S.count(sub[, start[, end]]) -> int
# In contrast, str.strip correctly shows the '/' marker
help(str.strip)
# Relevant output line:
# strip(self, chars=None, /) unbound builtins.str method
Description
There is an inconsistency in the signature displayed by the built-in help() function for str.count when compared to other similar methods like str.strip.
While str.count is functionally a positional-only argument method (it raises a TypeError if called with keyword arguments), its signature in help() does not include the / marker to indicate this. This is inconsistent with other methods that correctly display the positional-only marker.
This can be a minor point of confusion for users learning about Python's function signatures and introspection.
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Bug report
Bug description:
Description
There is an inconsistency in the signature displayed by the built-in
help()function forstr.countwhen compared to other similar methods likestr.strip.While
str.countis functionally a positional-only argument method (it raises aTypeErrorif called with keyword arguments), its signature inhelp()does not include the/marker to indicate this. This is inconsistent with other methods that correctly display the positional-only marker.This can be a minor point of confusion for users learning about Python's function signatures and introspection.
CPython versions tested on:
3.12
Operating systems tested on:
Windows