Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-12 Thread Robert Brewer
Glyph Lefkowitz wrote: > On Sep 11, 2011, at 11:49 AM, Michael Foord wrote: > Does anyone *actually* use .title() for this? > > Yes.  Twisted does, in various MIME-ish places (IMAP, SIP), > although not in HTTP from what I can see.  I imagine other > similar software would as well. Not to mention

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-11 Thread Glyph Lefkowitz
On Sep 11, 2011, at 11:49 AM, Michael Foord wrote: > Does anyone *actually* use .title() for this? (And why not just use the > correct casing in the string literal...) Yes. Twisted does, in various MIME-ish places (IMAP, SIP), although not in HTTP from what I can see. I imagine other similar

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-11 Thread Michael Foord
On 08/09/2011 03:46, Stephen J. Turnbull wrote: Glyph Lefkowitz writes: > On Sep 7, 2011, at 10:26 AM, Stephen J. Turnbull wrote: > > > How about "title"? > > >>> 'content-length'.title() > 'Content-Length' > Does anyone *actually* use .title() for this? (And why not just

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Stephen J. Turnbull
Glyph Lefkowitz writes: > On Sep 7, 2011, at 10:26 AM, Stephen J. Turnbull wrote: > > > How about "title"? > > >>> 'content-length'.title() > 'Content-Length' > > You might say that the protocol "has" to be case-insensitive so > this is a silly frill: Not me, sir. My whole point about

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Nick Coghlan
On Thu, Sep 8, 2011 at 3:51 AM, Glyph Lefkowitz wrote: > On Sep 7, 2011, at 10:26 AM, Stephen J. Turnbull wrote: > > How about "title"? > 'content-length'.title() > 'Content-Length' > You might say that the protocol "has" to be case-insensitive so this is a > silly frill: there are definitely

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Glyph Lefkowitz
On Sep 7, 2011, at 10:26 AM, Stephen J. Turnbull wrote: > How about "title"? >>> 'content-length'.title() 'Content-Length' You might say that the protocol "has" to be case-insensitive so this is a silly frill: there are definitely enough case-sensitive crappy bits of network middleware out the

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Stephen J. Turnbull
Antoine Pitrou writes: > You could also point out UTF-16 or EBCDIC, but I fail to see how that's > relevant. Do you have problems with ISO 2022 when parsing, say, e-mail > headers? Yes, of course! Especially when it's say, packed EUC not encapsulated in MIME words. I think Mailman now handle

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Simon Cross
On Wed, Sep 7, 2011 at 6:31 PM, Simon Cross wrote: > http://www.google.com/codesearch#search/&q=swapcase%20lang:%5Epython$&type=cs > > There are quite a few hits but more people appear to be > re-implementing it than using it (I haven't gone to the trouble of > mining the search results to get an

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Simon Cross
On Tue, Sep 6, 2011 at 10:36 PM, "Martin v. Löwis" wrote: >> Which applications? I'm not sure the number of applications using >> str.swapcase gets even as high as ten. > > I think this is what people underestimate. I can't name > applications either - but that doesn't mean they don't exist. > I'm

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-07 Thread Antoine Pitrou
On Wed, 07 Sep 2011 11:15:04 +0900 "Stephen J. Turnbull" wrote: > Antoine Pitrou writes: > > > Bytes objects are often used for partly ASCII strings, > > All I can say to that phrase is, "urk, ISO 2022 anyone?" You could also point out UTF-16 or EBCDIC, but I fail to see how that's relevant. D

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Nick Coghlan
On Wed, Sep 7, 2011 at 11:53 AM, Stephen J. Turnbull wrote: > Nick Coghlan writes: >  > The case-related methods, though, have no place in sane wire >  > protocol handling. > > RFC 822 headers are a somewhat insane but venerable (isn't that true > of anything that's reached age 350 in dog-years?),

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Stephen J. Turnbull
Antoine Pitrou writes: > Bytes objects are often used for partly ASCII strings, All I can say to that phrase is, "urk, ISO 2022 anyone?" > not arbitrary "arrays of bytes". And making indexing of bytes > objects return ints was IMHO a mistake. Bytes objects are not ASCII strings, even though

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Stephen J. Turnbull
Nick Coghlan writes: > However, a big +1 for deprecation in the case of bytes and bytearray. > That's nothing to do with the maintenance burden though, it's to do > with the semantic confusion between binary data and ASCII-encoded text > implied by the retention of methods like upper(), lower(

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Antoine Pitrou
On Wed, 7 Sep 2011 10:47:16 +1000 Nick Coghlan wrote: > > However, a big +1 for deprecation in the case of bytes and bytearray. > That's nothing to do with the maintenance burden though, it's to do > with the semantic confusion between binary data and ASCII-encoded text > implied by the retention

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Steven D'Aprano
Raymond Hettinger wrote: On Sep 6, 2011, at 1:36 PM, Martin v. Löwis wrote: I think this is what people underestimate. I can't name applications either - but that doesn't mean they don't exist. Google code search is pretty good indicator that this method has near zero uptake. If it dies, I

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Nick Coghlan
On Wed, Sep 7, 2011 at 7:23 AM, Raymond Hettinger wrote: > > On Sep 6, 2011, at 1:36 PM, Martin v. Löwis wrote: > > I think this is what people underestimate. I can't name > applications either - but that doesn't mean they don't exist. > > Google code search is pretty good indicator that this meth

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Raymond Hettinger
On Sep 6, 2011, at 1:36 PM, Martin v. Löwis wrote: > I think this is what people underestimate. I can't name > applications either - but that doesn't mean they don't exist. Google code search is pretty good indicator that this method has near zero uptake. If it dies, I don't think anyone will

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Martin v. Löwis
> Which applications? I'm not sure the number of applications using > str.swapcase gets even as high as ten. I think this is what people underestimate. I can't name applications either - but that doesn't mean they don't exist. I'm deeply convinced that the majority of Python code (and I mean *larg

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Michael Foord
On 6 Sep 2011, at 21:18, Martin v. Löwis wrote: >>> Perhaps I missed something early on, but why are we proposing >>> removing a function which (presumably) is stable and tested and >>> works and is not broken? What maintenance is needed here? >> >> >> The maintenance burden is on other implement

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Martin v. Löwis
>> Perhaps I missed something early on, but why are we proposing >> removing a function which (presumably) is stable and tested and >> works and is not broken? What maintenance is needed here? > > > The maintenance burden is on other implementations. It's not a maintenance burden (at least not i

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Barry Warsaw
On Sep 06, 2011, at 03:42 PM, Fred Drake wrote: >On Tue, Sep 6, 2011 at 3:36 PM, Steven D'Aprano wrote: >> pERSONNALLY, i THINK THAT A SWAPCASE COMMAND IS ESSENTIAL FOR TEXT EDITOR >> APPLICATIONS, TO AVOID THOSE LITTLE cAPS lOCK ACCIDENTS. > >There's a better solution to that, but the caps lock

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Fred Drake
On Tue, Sep 6, 2011 at 3:36 PM, Steven D'Aprano wrote: > pERSONNALLY, i THINK THAT A SWAPCASE COMMAND IS ESSENTIAL FOR TEXT EDITOR > APPLICATIONS, TO AVOID THOSE LITTLE cAPS lOCK ACCIDENTS. There's a better solution to that, but the caps lock lobby has a stranglehold on keyboard manufacturers.

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Michael Foord
On 6 Sep 2011, at 20:36, Steven D'Aprano wrote: > Terry Reedy wrote: >> On 9/6/2011 12:58 PM, Tres Seaver wrote: >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA1 >>> >>> On 09/06/2011 12:59 PM, Stephen J. Turnbull wrote: Joao S. O. Bueno writes: > Removing it would mean explici

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Steven D'Aprano
Terry Reedy wrote: On 9/6/2011 12:58 PM, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/06/2011 12:59 PM, Stephen J. Turnbull wrote: Joao S. O. Bueno writes: Removing it would mean explicitly "batteries removal". That's what we usually do with a dead battery, no?

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Terry Reedy
On 9/6/2011 12:58 PM, Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/06/2011 12:59 PM, Stephen J. Turnbull wrote: Joao S. O. Bueno writes: Removing it would mean explicitly "batteries removal". That's what we usually do with a dead battery, no? Normally one "replac

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/06/2011 12:59 PM, Stephen J. Turnbull wrote: > Joao S. O. Bueno writes: > >> Removing it would mean explicitly "batteries removal". > > That's what we usually do with a dead battery, no? Normally one "replaces" dead batteries. :) Tres. - --

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Stephen J. Turnbull
Joao S. O. Bueno writes: > Removing it would mean explicitly "batteries removal". That's what we usually do with a dead battery, no? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Joao S. O. Bueno
On Mon, Sep 5, 2011 at 8:56 AM, Michael Foord wrote: > Hey all, > A while ago there was a discussion of the value of apis like str.swapcase, > and it was suggested that even though it was acknowledged to be useless the > effort of deprecating and removing it was thought to be more than the value >

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-06 Thread Antoine Pitrou
Michael Foord voidspace.org.uk> writes: > > Earlier this year I was at a pypy sprint helping to work on Python 2.7 compatibility. The bytearray type has much of the string interface, including swapcase… So there was effort to implement this method with the correct semantics for pypy. Doubtless th

[Python-Dev] Maintenance burden of str.swapcase

2011-09-05 Thread Michael Foord
Hey all, A while ago there was a discussion of the value of apis like str.swapcase, and it was suggested that even though it was acknowledged to be useless the effort of deprecating and removing it was thought to be more than the value in removing it. Earlier this year I was at a pypy sprint