On 11/27/2013 9:03 PM, Victor Hooi wrote:
Hi,
Also, forgot two other examples that are causing me grief:
cur.executemany("INSERT INTO foobar_foobar_files VALUES (?)",
[[os.path.relpath(filename, foobar_input_folder)] for
filename in filenames])
I've already broken it up using the parentheses, not sure what's the tidy way to break it
up again to fit under 80? In this case, the 80-character mark is hitting me around the
"for filename" towards the end.
add another linebreak, you are still inside the parens.
and:
if os.path.join(root, file) not in
previously_processed_files and os.path.join(root, file)[:-3] not in
previously_processed_files:
In this case, the 80-character mark is actually partway through "previously
processed files" (the first occurrence)...
You can add parens. In this case, factoring out the common subexpression
and replaced the repeated long name does the job.
p = os.path.join(root, file)
ppf = previously_processed_files
if p not in ppf and p[:-3] not in ppf:
[snip previous post]
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list