Hi Neil, On 2010-08-17 14:42, Neil Cerutti wrote: > On 2010-08-17, Michael Torrie <torr...@gmail.com> wrote: >> In general if I find myself consistently going longer than 75 >> or 80 characters, I need to refactor my code to make it more >> manageable. If I have to scroll up five pages to find the >> beginning of a block, that normally means my code could be >> simplified and improved. > > Looking through my code, the split-up lines almost always include > string literals or elimination of meaningless temporary > variables, e.g.: > > self.expiration_date = translate_date(find(response, > 'MPNExpirationDate').text, '%Y-%m-%d', '%m%d%Y')
I'd probably reformat this to self.expiration_date = translate_date( find(response, 'MPNExpirationDate').text, '%Y-%m-%d', '%m%d%Y') or even self.expiration_date = translate_date( find(response, 'MPNExpirationDate').text, '%Y-%m-%d', '%m%d%Y') for consistency. This not only limits the width but also makes the nesting of the calls more visible. Stefan -- http://mail.python.org/mailman/listinfo/python-list