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

Rustom Mody rustompmody at gmail.com
Sat Mar 29 01:21:50 EDT 2014


On Saturday, March 29, 2014 10:38:47 AM UTC+5:30, Chris Angelico wrote:
> On Sat, Mar 29, 2014 at 3:40 PM, Mark H Harris wrote:
> > On 3/28/14 10:51 PM, Steven D'Aprano wrote:
> >> You are being patronising to the 94% of the world that is not from the
> >> USA. Do you honestly think that people all over the world have been using
> >> computers for 30 or 40 years without any way to enter their native
> >> language?
> > uh, pretty much.   That's why they called it ASCII American Standard Code
> > for Information Interchange...  yup, pretty much. Worked pretty well too,
> > for many many years, because so many languages derive from Latin, and most
> > non third world countries use Latin derived character sets; yes, although
> > missing dieresis and grave and acute accents, &c.

> ... wow.

> Okay. History lesson time.

> http://nedbatchelder.com/text/unipain.html
> http://en.wikipedia.org/wiki/Code_page

> Back before I was born, people were using computers to write messages
> that weren't in English. And they managed it, somehow. Can't imagine
> how, if all computers work exclusively with seven-bit Latin-derived
> character sets.

> "Most non-third-world countries use Latin-derived character sets".
> Hmm. Let's see. Greece, Russia, China, Japan, Israel, and Egypt are
> either third-world or just so insignificant that you can ignore them
> and say "most". Yeah, okay, we'll take that as read.

> Names are notoriously inaccurate when it comes to internationality.
> Ever heard of a place called IHOP? I hadn't, until I started talking
> to Americans. What's the difference between "global" and "universal"?
> We're clearly taking no notice of Martian languages here, much less
> anything outside our solar system. (If humans had non-FTL space travel
> five thousand years ago, there could now be colonies all over the
> universe, and we wouldn't necessarily even know about them. Those
> people would speak languages that can't possibly be Latin-derived;
> most likely they'd be derived from Hebrew or Arabic. In the event that
> they make contact, we're going to have to allocate some Unicode planes
> to them.) "Extended ASCII" is as international as Unicode, just less
> standardized.

> ChrisA

For Indian languages there is usually a specific fully localized
layout and a latin-derived one.

In particular for devanagari, which is directly used (Hindi, Marathi)
or close relative used (Gujarati, Bengali) there is inscript and itrans
https://fedoraproject.org/wiki/I18N/Indic/HindiKeyboardLayouts

itrans is the latin-derived layout, inscript is the fully-localized,
no-relation-to-US-104 one.

I would not be able to use the inscript if I tried and this is true for
most of the people I know even though in some theoretically ergonomic
sense its more efficient.

So in the sphere I am familiar with Mark seems to be right that
ASCII == US-104 rules the planet.

To go from this small-sample data to vast generalizations...
I'll leave to others



More information about the Python-list mailing list