> I like the read-only dictionary better than the boolean test > methods. It minimizes the effort in upgrading existing code of the > form: > > for c in string.lowercase: > do something > if c in string.lowercase: > do something > > I can global search/replace string.lowercase with str.lower in > dictionary form and everything will run fine (and faster too). I think this is not enough motivation. We have a whole slew of test methods already. Also the dict approach doesn't scale to Unicode (the dicts would have to be enormous) while the test method approach easily scales to Unicode (it's already implemented that way there). > Also, I like the mapping because provides a way to see the > membership. With the string form or the mapping form, it's easy to > find-out exactly what is defined as whitespace. If there is a C > coded boolean test, I have to filter the whole alphabet or look it > up in the docs. A very minor advantage indeed -- and again one that doesn't scale to Unicode. > If we can get some agreement that this is the way to go, I can work > with the OP on a revised patch so we get the string module silently > deprecated. Maybe you can do a patch for isxxx() methods instead? --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4