Re: [Python-checkins] CVS: python/dist/src/Lib/plat-irix5 cddb.py,1.10,1.11
On Fri, Feb 09, 2001 at 08:44:51AM -0800, Eric S. Raymond wrote:
String method conversion.
Andrew replied:
Regarding the large number of string method conversion check-ins: I presume this is something else you discussed at LWE with Guido. Was there anything else discussed that python-dev should know about, or can help with?
This was Eric's own initiative -- I was just as surprised as you, given the outcome of the last discussion on python-dev specifically about this. However, I don't mind that it's done, as long as there's no code breakage. Clearly, Eric went a bit fast for some modules (checking in syntax errors :-). --Guido van Rossum (home page: http://www.python.org/~guido/)
Guido van Rossum <guido@digicool.com>:
Clearly, Eric went a bit fast for some modules (checking in syntax errors :-).
It was the oddest thing. The conversion was so mechanical that I found my attention wandering -- the result (as I noted in a couple of checkin comments) was that I occasionally hit ^C^C and triggered the commit a step too early. Sometimes Emacs makes things too easy! There were a couple of platform-specific modules I couldn't test completely, stuff like the two cddb.py versions. Other than that I'm pretty sure I didn't break anything. Where the test jigs looked lacking I beefed them up some. The only string imports left are the ones that have to be there because the code is using a string module constant like string.whitespace or one of the two odd functions that don't exist as methods, zfill and maketrans. Are there any plans to introduce boolean-valued string methods corresponding to the ctype.h functions? That would make it possible to remove most of the remaining imports. This was like old times. pulling an all-nighter to clean up a language library. I did a *lot* of work like this on Emacs back in the early 1990s. Count your blessings; the Python libraries are in far better shape. -- <a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a> Certainly one of the chief guarantees of freedom under any government, no matter how popular and respected, is the right of the citizens to keep and bear arms. [...] the right of the citizens to bear arms is just one guarantee against arbitrary government and one more safeguard against a tyranny which now appears remote in America, but which historically has proved to be always possible. -- Hubert H. Humphrey, 1960
The only string imports left are the ones that have to be there because the code is using a string module constant like string.whitespace or one of the two odd functions that don't exist as methods, zfill and maketrans. Are there any plans to introduce boolean-valued string methods corresponding to the ctype.h functions? That would make it possible to remove most of the remaining imports.
Yes, these already exist, e.g. s.islower(), s.isspace(). Note that they are locale dependent.
This was like old times. pulling an all-nighter to clean up a language library. I did a *lot* of work like this on Emacs back in the early 1990s. Count your blessings; the Python libraries are in far better shape.
Thanks! --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (2)
-
Eric S. Raymond
-
Guido van Rossum