[Python-ideas] Making stars optional? (was: Making colons optional?)

Curt Hagenlocher curt at hagenlocher.org
Thu Feb 5 20:04:51 CET 2009


On Thu, Feb 5, 2009 at 10:30 AM, Bruce Leban <bruce at leapyear.org> wrote:
> In algebra, you don't have to put a multiplication sign in between two
> quantities that you want to multiply. I've seen beginning programmers write
> things like
>
>     x = 3a + 4(b-c)
>
> instead of
>
>     x = 3*a + 4*(b-c)
>
> Why should we require the stars when it's unambiguous what the first
> statement means?

Sure, and given the following program:
    a = 2
    b = 4
    print ab
shouldn't we be able to print "8", given that the meaning of the
program is unambiguous?


Ultimately, you have to balance ease-of-use against consistency --
both because too much inconsistency can actually harm ease-of-use and
because "special cases" tend to combine in crazy ways to create
horrible edge cases.  Where to draw the line is always a matter of
personal taste, but the Python language has consistently favored
consistency in its philosophy.

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Python-ideas mailing list