Re: Just curious: who is using Pike for what?
Chris Angelico <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAPTjJmqovSxwcxXR=Ma7uq4Oowd2YtJeK5xDdgR1ZmzThdjAUw@mail.gmail.com> |
On Wed, Dec 14, 2016 at 10:05 PM, Peter Bortas @ Pike importmöte för mailinglistan <[email protected]> wrote: >>On Tue, 13 Dec 2016, Chris Angelico wrote: >>>> upper_case("ß") == "ß"; >>> (1) Result: 1 > >>> Python does: >>>>>> "ß".upper() >>> 'SS' > > Discussed this with grubba Yesterday. I don't think upper_case should > do this. Besides sometimes (possibly supricingly) introducing more > characters in a string it would break the > lower_case(upper_case(a)) == a > symmetry. > > We should have a separate function for doing this in the Unicode > module, but I can't come up with a good name for > it. Unicode.upper_case() would not be particularly self > documenting. Unicode.special_upper_case()? > The Unicode spec doesn't say that case conversions have to be symmetrical. I don't particularly like the term "special", as it implies that it handles _only_ the special cases; can't we use "Unicode.upper_case"? In most situations, it's going to return the same thing that upper_case does, so the choice between the two would be down to whether you care about the string staying the same length, or about the strict conversions. ChrisA