On Sun, Jul 29, 2018 at 12:08:46PM -0500, Abe Dillon wrote: > look-ahead and back-tracing is how people read punctuation like '?' and '!' > in natural language
I really wish you would stop talking about "natural language" as if there were only one (and it were English). Many natural languages don't even have punctuation like '?', or if they do, they are a very recent innovation. Spanish uses a bracketing pair of marks: ¿Qué Mr Fawlty? while many other European languages make do with just one at the end. And not all of them use the same symbol. (Greek uses the semi-colon, which must make reading C-like languages a remarkable experience.) But even in English, that isn't how people read questions in general, which is why we can still comprehend punctuation-less sentences what's for dinner where are you who was the German professor in Lord Palmerston's quote about the Schleswig-Holstein business as questions, despite the lack of a question mark. Questions really only need the question mark if they would otherwise be ambiguously either a statement or a question. You may be able to find examples of English questions which do require back-tracking, but that is generally considered to be a bad thing, increasing surprise (not a good thing unless you are attempting humour) and reducing the speed and ease of comprehension. See my earlier link about garden path sentences. In other words, reducing not increasing readability. > and there are plenty of examples of Python following > this pattern in other expressionized syntax like in comprehensions and > ternary expressions. But not binary operators which take only two arguments, in this case a name and an attribute name. > I actually think this makes sense for expressionized > syntax because it puts the "meat" before the "potatoes". When you're > reading code like: > > initials = [person.name[0] ... > > You can usually guess what goes in the `...` from context Can you? In that example I can't even guess if that's the start of a list comprehension or a list display. If its a comprehension, I sure as hell can't guess the important question of what it being iterated over. > so it's redundant, so it makes sense that it comes later. If it's redundant, why don't we just leave it out? -- Steve _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/