On Tue, Jan 30, 2018 at 12:00 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> > But it's also a readability question: "is_ascii()" and > > "is_UCS2()/is_BMP()" just require knowing what 7-bit ASCII and UCS-2 > > (or the basic multilingual plane) *are*, whereas the current ways of > > checking for them require knowing how they *behave*. > This is important. Agreed with all of those. > > However, given how niche the varieties other than is_ascii() are, I'm > not going to push for them. I use them rarely enough, or on small enough > strings, that doing an O(N) max(string) is not that great a burden. sure, but adding is_ascii() and is_bmp() are pretty small additions as well. I"d say for the newbiew among us, it would be a nice feature: +1 As for is_bmp() -- yes, UCS-2 is "deprecated", but there are plenty of systems that don't handle UTF-16 well, so it's nice to know, and not hard to write. I also think a UCS-2 encoding would be handy -- but I won't personally use it, so I'll wait for someone that has a use case to ask for it. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/