Division oddity
Peter Hansen
peter at engcorp.com
Tue Jan 13 14:18:56 EST 2004
Paul Rubin wrote:
>
> Peter Hansen <peter at engcorp.com> writes:
> > > Well, the documentation for "input()" says "Equivalent to
> > > eval(raw_input(/prompt/))". Perhaps it should say "/Usually/
> > > equivalent...."
> >
> > I remember reading that too, and just assumed that at this point
> > it was in fact *implemented* that way, as a simple alias. Maybe
> > it should be...
>
> Python has no support for macros or aliases, and it would be silly
> to add some special kludge for input(). The user needs to be able
> to redefine the function and so forth too.
Sure it does:
def input(*args):
return eval(raw_input(*args))
That's what I mean by "alias", anyway.... same as the implementation
which I understand is used for string.methodx(s) nowadays, which is
apparently just passed on to s.methodx().
-Peter
More information about the Python-list
mailing list