English-like Python

Aaron Brady castironpi at gmail.com
Thu Jan 22 03:28:43 EST 2009


On Jan 22, 2:17 am, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Wed, 21 Jan 2009 08:17:34 -0700, Joe Strout wrote:
> > But of course.  Any method call is legal only if the form of the call
> > matches the method prototype -- if you try to call a function that
> > requires 4 parameters, and give it only 3, that's an error too.  I don't
> > see how this is different in any important way.
>
> But it isn't (presumably) a syntax error.

It often is a compile-time error, as opposed to run-time.  However, if
Joe meant to distinguish between 'Give the ball to Jamie' and 'Give
the ball', it is a syntax error: 'Give( the ball, Jamie )' vs. 'Give
( the ball )'.  (Wait, is 'give the ball' a syntax error or what?)

> I accept that in practice, it isn't a big deal once you get used to the
> convention. But it's a special case -- why treat functions of zero
> arguments as a special case just to save two characters?

In fact, NLs clearly mark the difference between commanding a process,
and nominating it.  'Go to the store' is the imperative, while 'Going
to the store' is the nominative.  In this case, 'ing' serves to mark
the absence of parentheses, and the bare form, without 'ing', marks
the call.



More information about the Python-list mailing list