Python from Wise Guy's Viewpoint
David Eppstein
eppstein at ics.uci.edu
Mon Oct 20 14:15:12 EDT 2003
In article <mailman.262.1066668221.2192.python-list at python.org>,
Gerrit Holl <gerrit at nl.linux.org> wrote:
> > I fail to see the lack of uniformity. "print" and "del" are statements,
>
> I think it is not uniform that print and del are statements rather than
> functions, since they don't do control flow (just like exec). In all
> three cases, I don't see why it is a statement.
It's not obvious how to write e.g. del a[x] as a function, since the
argument is an lvalue (position x of list a) rather than an rvalue (the
item in position x of list a).
Exec needs to be executed in the current scope, not the scope of another
function call.
Print, I agree, is something of a wart, but a useful one.
--
David Eppstein http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science
More information about the Python-list
mailing list