[Python-ideas] unicodedata.itergraphemes (or str.itergraphemes / str.graphemes)

David Kendal me at dpk.io
Wed Jul 10 01:15:23 CEST 2013


On 9 Jul 2013, at 17:51, Bruce Leban <bruce at leapyear.org> wrote:

> If you want to do any operation on the clusters other than in iteration
> order, without indexed access you're going to end up doing
> list(grapheme_clusters(...)) first to give you indexed access. Maybe that's
> the right thing to do sometimes but I wouldn't force it on people. The
> string already provides indexed access but I need to know cluster
> boundaries.

There's no reason the iterator returned can't be of a new type that allows indexing with the subscript operator.

> --- Bruce

dpk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130710/5f9230d6/attachment.pgp>


More information about the Python-ideas mailing list