[Python-ideas] Silent bugs - was Re: PEP8 operator must come before line break

Steven D'Aprano steve at pearwood.info
Fri Apr 15 00:27:39 EDT 2016


On Thu, Apr 14, 2016 at 09:30:56PM +0100, Erik wrote:

> However, that doesn't answer my question of when a line consisting of 
> just "+ expr" is a useful thing.

Almost nowhere.

But, if you have a DSL that operates in a imperative fashion (giving 
commands, rather than returning results in a functional fashion) you 
might do something like:

+tracing
command()
command()
-tracing

which is modelled after the doctest directives:

# doctest: +SKIP
# doctest: -NORMALIZE_WHITESPACE

etc. I don't think this imperative style is a really good fit for 
Python's syntax, but it could work for some people.


-- 
Steve


More information about the Python-ideas mailing list