comments and the continuation prompt
Ben Finney
ben+python at benfinney.id.au
Sun Jun 25 23:32:42 EDT 2017
Steve D'Aprano <steve+python at pearwood.info> writes:
> On Mon, 26 Jun 2017 08:44 am, Stefan Ram wrote:
>
> > According to The Python Language Reference Release 3.6.0, 2.1.3
> > Comments, »A comment signifies the end of the logical line unless
> > the implicit line joining rules are invoked.«.
> >
> > So, why do I get a continuation prompt when I enter a comment?
>
> Why not? As far as the interactive interpreter is concerned, you
> haven't yet entered a statement.
And yet, according to the Language Reference, the logical line has ended
and another begun.
So I think the question is worth exploring: Why does the interactive
prompt imply the logical line is continuing, when the Language Reference
would say otherwise?
Maybe the answer is “the continuation prompt does not prompt for the
continuation of a logical line, but the continuation of <something
else>”.
What exactly goes in the “<something else>” placeholder; that is,
exactly what should the user understand by that transition from one
prompt to a different one?
--
\ “Philosophy is questions that may never be answered. Religion |
`\ is answers that may never be questioned.” —anonymous |
_o__) |
Ben Finney
More information about the Python-list
mailing list