Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-650

Change our Python standard to put binary operators at the beginning of a continuation line


    • Type: RFC
    • Status: Adopted
    • Resolution: Unresolved
    • Component/s: DM
    • Labels:
    • Location:
      This ticket


      Our current Python coding standard is to break long lines at a binary operator by having the binary operator at the end of the line. I propose to change this, for two reasons:

      • The puts a critical piece of information (the binary operator) first, where it is easy to see and not lost in a sea of text.
      • It matches what "black" does. So if we start formatting any of our packages with "black" the results will look familiar. (see RFC-649).

      My proposed means of adoption is:

      • Change one package at a time, as time permits and people have inclination.
      • Change a package by first changing setup.cfg to suppress W503 instead of W504 (they are complementary), then fixing any flake8 warnings.

      I believe that continuation lines are rare enough and that existing code is readable enough, that there is no rush on making this change. I envision it as something someone might choose to do if one is already editing a package.


          Issue Links



              • Assignee:
                rowen Russell Owen
                rowen Russell Owen
                Ian Sullivan, Jim Bosch, John Parejko, John Swinbank, Kian-Tat Lim, Russell Owen, Tim Jenness
              • Votes:
                0 Vote for this issue
                7 Start watching this issue


                • Created:
                  Planned End:

                  Summary Panel