Answer by Nick Sloan for Formatting SQLAlchemy code
Came here hoping for a better solution, but I think I prefer the parentheses wrapping style:subkeyword = ( Session.query( Subkeyword.subkeyword_id, Subkeyword.subkeyword_word )...
View ArticleAnswer by Russ for Formatting SQLAlchemy code
I'm a frequent user of the backslashes in a similar way to what zzzeek indicated in his answer. PEP8 is just a guideline, don't lose sleep over it when you violate it!However, I also frequently use the...
View ArticleAnswer by Barry Warsaw for Formatting SQLAlchemy code
Yeah, these are going to be nasty no matter what you do, so to the extent that you can split these constructs up into shorter lines, definitely do so.When you can't, you can probably get rid of all...
View ArticleAnswer by zzzeek for Formatting SQLAlchemy code
pep-8 discourages backslashes but for SQLAlchemy code I can't help but think they're the most readable, as you can keep each generative function at the start of its own line. If there's many arguments...
View ArticleFormatting SQLAlchemy code
We're trying to follow the PEP8 guidelines for formatting our Python code and staying below 80 characters per line.Our SQLAlchemy lines are particularly troublesome, having lots of chained methods and...
View Article
More Pages to Explore .....