On Wed, Apr 3, 2013 at 12:52 AM, Chris Angelico <ros...@gmail.com> wrote: > Hmm. I was about to say "Can you just do a quick collections.Counter() > of the string widths in 3.3, as an easy way of seeing which ones use > BMP or higher characters", but I can't find a simple way to query a > string's width. Can't see it as a method of the string object, nor in > the string or sys modules. It ought to be easy enough at the C level - > just look up the two bits representing 'kind' - but I've not found it > exposed to Python. Is there anything?
4 if max(map(ord, s)) > 0xffff else 2 if max(map(ord, s)) > 0xff else 1 -- http://mail.python.org/mailman/listinfo/python-list