News for hackers. Stuff that matters.
Re:Why Python 3 Exists by Veedrac on Thursday December 17, 2015 @02:32PM (#10753824)
> Swift gives up on the idea that len(x+y) = len(x) + len(y). This is just something you have to remember; in UI programming, however, it makes a lot of sense because adding an accent to an existing string isn't going to make it take up more width in the text box. (x + y).utf8.count == x.utf8.count + y.utf8.count, however.

So do fullwidth characters have a length of 2?

If not, how is this useful for finding the size of text in a text box anyway?

Re:Why Python 3 Exists by nostrademons on Thursday December 17, 2015 @02:46PM (#10753948)
I'm speaking more to the idea that when you concatenate strings, various important properties might not change. To get the actual size in pixels, you'd do str.sizeWithAttributes([NSFontAttributeName: myFont]).width, which is a whole other can of worms.