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

Terry Reedy tjreedy at udel.edu
Fri Apr 4 06:43:12 EDT 2014


On 4/4/2014 5:53 AM, Steven D'Aprano wrote:
> On Thu, 03 Apr 2014 11:38:13 -0500, Mark H Harris wrote:
>
>> On 4/1/14 5:33 PM, Terry Reedy wrote:
>>> If you narrowly meant "The python interpreter only starting using
>>> unicode as the default text class in 3.0", then you are, in that narrow
>>> sense, correct.

I really should have said "3.0 was the first version of Python (the 
language) to specify that code and strings are unicode"

>>      Yes. When I speak of 'python' I am almost always speaking about the
>> interpreter.
>
> Which interpreter?

Since the unicode change is a language and not an interpreter issue, it 
does not matter.

 > Unicode is completely uninteresting to comp-sci. Whether strings
 > contain 127 symbols or 1114112 or 2 is just a boring detail.

Until CS researchers want to write academic papers with non-ascii 
symbols ;-).

>> On the python unicode continuum version (3) is more useful than
>> version (2). ( this is of course relative and debatable, so the
>> statement is rhetorical )
>
> Now that's funny.

I agree.

 > You make a completely non-controversial statement, that
> Python 3's Unicode implementation is more useful (i.e. more functionally
> complete, fewer design flaws, more efficient) than Python 2's, and *that*
> is the claim that you smother to death in disclaimers.

-- 
Terry Jan Reedy




More information about the Python-list mailing list