Alan Gauld wrote: > >> Why does the python shell says this: >> >>>>> print exec.__doc__ >>>> >> File "<stdin>", line 1 >> print exec.__doc__ >> ^ >> SyntaxError: invalid syntax > > > exec, like print, is a statement, or command, not a function. > > You get the same response if you try > >>>> print print.__doc__ >>> > > or > >>>> help(print) >>> > >> While it works with "eval". > > > eval is a function so has a doc string attached. > > Alan G.
Thanks. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor