python / python/cpython

The docstring of `str()` should show the default values for object, encoding and errors and should say `bytes-like object`

Aperta
#137,112 6 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@terryjreedy ci sta già lavorando.

Dal 26/7/2025.

docs interpreter-core triaged
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.