Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

Chris Angelico rosuav at gmail.com
Tue Apr 1 17:49:21 EDT 2014


On Wed, Apr 2, 2014 at 8:26 AM, Mark H Harris <harrismh777 at gmail.com> wrote:
>    Python3 finally started getting unicode right. The fact that it 'existed'
> in some form prior to (3) is not meaningful, nor helpful.
> When I said, "python has only really used it since python3, right?," I meant
> that unicode in python2 was a mess (and incomplete, and I could go on) but
> finally---in python3---it is becoming useful (even though it still has
> glitches). I don't know why we need to argue about it.

Please elaborate. Apart from the default double-quoted string being a
byte string (which can be changed with a future directive), and the
consequent likelihood that library functions will expect str rather
than unicode, what was such an incomplete mess in Py2 that made
Unicode completely useless? Personally, I'd still rather work with
Unicode in Py2 than in C, REXX, or any other completely Unicode-naive
language.

ChrisA



More information about the Python-list mailing list