"D'Arcy J.M. Cain" <[email protected]>:
> On Wed, 17 Aug 2016 16:39:30 +1000
> Steven D'Aprano <[email protected]> wrote:
>> cond ? trueval : falseval
>>
>> Because the C syntax is horrifically ugly, whereas the Python syntax
>> is very close to real English syntax.
>
> Or, put another way, Python prefers English over line noise.
It can also be confusing. I recently introduced programming to someone
using Python. Because of its similarity with English, they thought
Python understood stuff like:
if x or y == 0:
...
for:
if x == 0 or y == 0:
...
or:
if (x, y) is self.on_point():
...
for:
if self.on_point(x, y):
...
Somewhat analogously, I remember how confusing it was to learn formal
logic in college. I was having a hard time getting the point of
definitions like:
(x ∧ y) is true iff x is true and y is true
That's because I had learned in highschool that "x ∧ y" was just an
abbreviation of "x and y".
Marko
--
https://mail.python.org/mailman/listinfo/python-list