On Sun, Jul 26, 2015 at 10:58 AM, Rich Shepard <rshep...@appl-ecosys.com> wrote:
>   I've numbered the lines in this code fragment:
>
> 83   category = Column(Unicode(16), value = 'Environmental', nullable =
> False,
> 84                     CheckConstraint(
> 84       "category IN('Air', 'Environmental', 'Health', 'Safety',
> 'Occupancy',
> 86       'Water'"))

So that would be formatted like so:

https://gist.github.com/sigmavirus24/67268ec32d614dffbcd1

I used a gist because it uses pre-formatted (fixed-width font) text so
that it's much clearer than email where depending on your reader it
can either be fixed with, or variable width, etc.

That said, your "CheckConstraint" parameter looks odd to me but I
copied it and made it appropriately multi-line as you would expect it
to work. (Taking advantage of the interpreter's native concatenation
of adjacent string literals.)

>    flake8 has these errors:
>
> 84:39: E201 whitespace after '('
> 86:9: E128 continuation line under-indented for visual indent
>
>   I've read PEP8 and found several fora threads related to E128 and E201 but
> no matter how I reformat that statement I cannot remove these (or other)
> errors when flake8 runs on this module.
>
>   When I continue line 84 the '(' and emacs breaks it near column 78 I get a
> different error about closing brackets not being correctly aligned. But, no
> matter where I place the final bracket it shows an error.
>
>   This module has many error conditions simular to the above and I want to
> understand how these long lines should be formatted so flake8 no longer
> complains regardless of how I change the lines.
>
> Thanks in advance,
>
> Rich
>
>
> _______________________________________________
> code-quality mailing list
> code-quality@python.org
> https://mail.python.org/mailman/listinfo/code-quality
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to