[Python-ideas] Making colons optional? Syntactic alternative.

Chris Rebert pyideas at rebertia.com
Thu Feb 5 20:57:40 CET 2009

On Thu, Feb 5, 2009 at 11:53 AM, Andre Roberge <andre.roberge at gmail.com> wrote:
> On Thu, Feb 5, 2009 at 3:33 PM, Chris Rebert <pyideas at rebertia.com> wrote:
> [snip]
>> The other somewhat popular choices of assignment syntax that I've seen
>> are x := y, x <- y, and let x = y. The first and last of those still
>> use a =, albeit with something extra, and so aren't too much of a
>> stretch. x <- y is particularly deviant and isn't readable (as in read
>> it out loud) IMHO; you either have to read it right-to-left (which is
>> unnatural) as "Take y and put it into x", or as "x has y placed into
>> it" (which uses the passive voice and so does not fit well with an
>> imperative language.
> Furthermore, the "take y and put it into x" might be an appropriate
> interpretation for C but not for Python.  For Python it should be
> instead something like
> "Assign the name x to object y" which could be visually represented by
> x -> y    instead of x <- y as you mention.

Indeed. Of course, I think that commits the equally cardinal sin of
flipping the direction of the assignment operator, from variable-value
to value-variable. :)


Follow the path of the Iguana...

More information about the Python-ideas mailing list