<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 11, 2011, at 11:49 AM, Michael Foord wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Bitstream Vera Sans Mono'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">Does anyone *actually* use .title() for this? (And why not just use the correct casing in the string literal...)<br></span></span></blockquote></div><br><div>Yes. &nbsp;Twisted does, in various MIME-ish places (IMAP, SIP), although not in HTTP from what I can see. &nbsp;I imagine other similar software would as well.</div><div><br></div><div>One issue is that you don't always have a string literal to work with. &nbsp;If you're proxying traffic, you start from a mis-cased header and you possibly need to correct it to a canonically-cased one. &nbsp;(On at least one occasion I've had to use such a proxy to make certain buggy client software work.)</div><div><br></div><div>Of course you could have something like&nbsp;{b"CONNECTION-LOST": b"Connection-Lost", ...} somewhere at module scope, but that feels a bit sillier than just having a nice '.title()' method.</div><div><br></div><div>-glyph</div><div><br></div></body></html>