News for hackers. Stuff that matters.
Re:Speed improvements in Python 3.7 by mjevans on Tuesday February 13, 2018 @06:22PM (#16371868)
For compatibility reasons, len(unicode type) should probably return the size if accessed as a raw 8 bit sequence, so an alias to .length_bytes. I also think the other names should similarly start with .length_ .
Re:Speed improvements in Python 3.7 by mark-r on Tuesday February 13, 2018 @06:35PM (#16371974)
len() should return the length in individual addressable units, so that obj[len(obj)-1] always returns the last item, whether that's a byte or a unicode character.