[MERGE] Document code layout stuff

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Sep 6 10:17:58 BST 2007


>>>>> "bialix" == Alexander Belchenko <bialix at ukr.net> writes:

    bialix> Martin Pool пишет:
    >>> What about assigning result to some value?
    >>> 
    >>> foo = self.legbone.kneebone.shinbone.toebone.shake_it(
    >>> one, two, three)
    >>> 
    >>> What correct rule for this case?
    >> 
    >> 'one' should be four spaces to the right of the start of the preceding
    >> line, 'foo'.  It's not indented relative to the assignment operator.

    bialix> I.e.:

    bialix> foo = self.legbone.kneebone.shinbone.toebone.shake_it(
    bialix>     one, two, three)

    bialix> or another dummy example:

    bialix> foobarspam = self.legbone.kneebone.shinbone.toebone.shake_it(
    bialix>     one, two, three)

    bialix> /me don't like this variant 'cause equal sign is hard to see here.

Then use:

 toebone = self.legbone.kneebone.shinbone.toebone
 foo = toebone.shake_it(one, two, three)

There is generally a good occasion to name 'toebone' in a way
that helps understanding why you have to dereference such a long
chain.

I know Robert made a remark about something having a strange
smell when splitting like this which I didn't understand.

        Vincent



More information about the bazaar mailing list