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

Roy Smith roy at panix.com
Mon Mar 31 08:16:30 EDT 2014


In article <lhb0on$pcj$1 at speranza.aioe.org>,
 Mark H Harris <harrismh777 at gmail.com> wrote:

> On 3/30/14 10:22 AM, Steven D'Aprano wrote:
> > In 1991, there was no wireless, no mobile computing, hardly any public
> > Internet outside of the universities. It was before the Eternal
> > September, and only a few years after the Great Renaming.
> 
>     I was using arpanet since the late 1970s.
> 
> > Python had just
> > been released for the first time, and Windows 3.1 hadn't been (although
> > 3.0 had). There was no Netscape, no Mosaic graphical web browsers. Steve
> > Jobs hadn't returned to Apple yet, Apple was still losing money and mind-
> > share, and Google didn't even exist. It was a different era.
> 
>     Command line all the way babe... uuencode uudecode base64  whoohoo.

Remember when btoa/atob came out?  You got 32 bits of data in just 5 
characters.  Win!

Waiting for btou :-)

> Unicode in python3.x is (mostly) working correctly. Congratulations to 
> all who worked on it, hat is off.  The problem with unicode is that it 
> is just a specification. The consortium cannot force or code anything. 
> They control the scripts and make the specifications. It is left to 
> *everyone* else to implement.

My first introduction to unicode was a monster i18n makeover on a large 
C++ codebase.  For reasons I no longer remember, we ended up settling on 
utf-8 for "native" strings (with, of course, our own string class), but 
we were also using some library which was utf-16 internally (ICU4C, I 
think?).  So, we were constantly transcoding all over the place.  What a 
mess.



More information about the Python-list mailing list