The docstring of `str()` should show the default values for object, encoding and errors and should say `bytes-like object`
Offen
@terryjreedy arbeitet bereits daran.
Seit 26.7.2025.
docs
interpreter-core
triaged
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
The docstring of str() doesn't show the default values for object, encoding and errors and does say bytes_or_buffer as shown below:
print(help(str))
# class str(object)
# | str(object='') -> str
# | str(bytes_or_buffer[, encoding[, errors]]) -> str
So, the docstring of str() should show the default values for object, encoding and errors and should say bytes-like object as shown below:
print(help(str))
# class str(object)
# | str(object='') -> str
# | str(object=b'', encoding='utf-8', errors='strict') -> str # Here
# | str(bytes-like object[, encoding[, errors]]) -> str
# Here
Linked PRs
- gh-142650
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.