New submission from Bob Helmbold: Summary: "title" method of string objects does not handle contractions and possessives correctly. See the following short program and its results for examples. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< """ Test of string method 'capitalize' """
stringList=["we're", "you're", "they're", "i've", "we've", "you've", "they've", "can't", "won't", "doesn't", "haven't", "daren't", "shouldn't", "weren't", "wasn't", "i'm" ] for item in stringList: n=len(item) spaces=' '*(12-n) itemTitled = item.title() isATitle = itemTitled.istitle() print "%s -> %s%s is title=%s" %(item, spaces, itemTitled, isATitle) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Results in: we're -> We'Re is title=True you're -> You'Re is title=True they're -> They'Re is title=True i've -> I'Ve is title=True we've -> We'Ve is title=True you've -> You'Ve is title=True they've -> They'Ve is title=True can't -> Can'T is title=True won't -> Won'T is title=True doesn't -> Doesn'T is title=True haven't -> Haven'T is title=True daren't -> Daren'T is title=True shouldn't -> Shouldn'T is title=True weren't -> Weren'T is title=True wasn't -> Wasn'T is title=True i'm -> I'M is title=True ---------- components: Interpreter Core messages: 58544 nosy: ElGordo severity: normal status: open title: bug in string method "title" type: behavior versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1614> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com