79 chars or more?

D'Arcy J.M. Cain darcy at druid.net
Tue Aug 17 11:42:56 EDT 2010


On Tue, 17 Aug 2010 16:28:02 +0200
Stefan Schwarzer <sschwarzer at sschwarzer.net> wrote:
> 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')

You can extend this if there are complicated sub-calls.  Probably
overkill for this example but here is the idea.

           self.expiration_date = translate_date(
             find(
               response,
              'MPNExpirationDate',
             ).text,
             '%Y-%m-%d',
             '%m%d%Y'
           )

I also moved the closing brace down to align with the line that opened
that block.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list