[Python-ideas] allow line break at operators

Ben Finney ben+python at benfinney.id.au
Sun Sep 18 12:22:50 CEST 2011


Arnaud Delobelle <arnodel at gmail.com>
writes:

> On 4 September 2011 23:39, Ben Finney <ben+python at benfinney.id.au> wrote:
> > Ben Finney <ben+python at benfinney.id.au> writes:
> >
> >> How many string literals do you count in the following statement? I
> >> count one:
> >>
> >>     raise HoustonWeHaveAProblemError(
> >>         "Lorem ipsum dolor sit amet,"
> >>         " consectetur adipiscing elit.")
>
> The code object says that there's one string constant in the compiled
> function. It says nothing (and knows nothing) about the number of
> string literals that made up this string.

Hmm. So how should I be looking to answer the question? My AST-fu is
weak.

-- 
 \                “Science doesn't work by vote and it doesn't work by |
  `\        authority.” —Richard Dawkins, _Big Mistake_ (The Guardian, |
_o__)                                                      2006-12-27) |
Ben Finney




More information about the Python-ideas mailing list