This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: string capitalize erroneously lower-case any non-first letters
Type: behavior Stage:
Components: None Versions: Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: famart, pjenvey
Priority: normal Keywords:

Created on 2010-04-08 17:05 by famart, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg102629 - (view) Author: Martin (famart) Date: 2010-04-08 17:05
When the following is run:
  s='the Los Angeles Symphony';
  s.capitalize();
it displays 'The los angeles symphony'
instead of 'The Los Angeles Symphony'

the str.capitalize() should only deal with the first letter, not lower-case the rest of the letters. The manual correctly describes this, but the actual behavior is not consistent with this description.
msg102637 - (view) Author: Philip Jenvey (pjenvey) * (Python committer) Date: 2010-04-08 17:45
S.capitalize() -> string

Return a copy of the string S with only its first character
capitalized.

You've misunderstood the docs, only the first character is indeed capitalized. You want string.capwords instead
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52594
2010-04-08 17:45:28pjenveysetstatus: open -> closed

nosy: + pjenvey
messages: + msg102637

resolution: not a bug
2010-04-08 17:05:31famartcreate