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

Created on 2010-04-08 17:05 by famart, last changed 2010-04-08 17:45 by pjenvey. 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
2010-04-08 17:45:28pjenveysetstatus: open -> closed

nosy: + pjenvey
messages: + msg102637

resolution: invalid
2010-04-08 17:05:31famartcreate