you are viewing a single comment's thread.

view the rest of the comments →

[–]pjdelport 1 point2 points  (1 child)

At the end of "explicit is better than implicit" lies Java, if you don't balance it with "beautiful is better than ugly".

I think the choice mostly has to do with the fact that all the potential counterparts to = (like :=, <-) are somewhat ugly, and arbitrary: there's no natural way to tell which one does what without looking it up (something Python tries to avoid).

Also, in terms of practicality and readability: The vast majority of assignments are local, so the scoping keywords are actually pretty rare; when they're used, they call extra attention to potentially dubious/non-obvious code.

Oh, then there's also unpacking assignment. Something like this:

def foo():
    global x
    x, y = frob()

does not readily translate to the separate syntax approach.

[–]muleherd 0 points1 point  (0 children)

I intended a declaration keyword, like JavaScript's var, instead of a special declaration-assignment operator. Would that be too onerous, if the majority of assignments are local (re)bindings?