# The rules for breaking long Python lines is changing

**URL:** <https://www.rubin.community/t/the-rules-for-breaking-long-python-lines-is-changing/4005>\
**Category:** DM Notifications\
**Created:** [January 23, 2020, 9:47pm UTC](https://www.rubin.community/t/the-rules-for-breaking-long-python-lines-is-changing/4005 "2020-01-23T21:47:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rowen](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/rowen/32/52_2.png) [@rowen](https://www.rubin.community/u/rowen)\
**Post date:** [January 23, 2020, 9:47pm UTC](https://www.rubin.community/t/the-rules-for-breaking-long-python-lines-is-changing/4005/1 "2020-01-23T21:47:50Z")

</div>

RFC-650 has been adopted: we are changing how we break long lines in Python so that binary operators should appear at the beginning of the continued line instead of the end of the previous line.

@timj has kindly updated the developer’s guide.

I will be working through packages updating them. The main change is changing W504 to W503 in the setup.cfg files and fixing the (likely very few) resulting warnings.

In cases where the binary operator is a `+` joining two strings I plan to simply remove the `+`.

If you have a global flake8 configuration file (such as ~/.config/flake8) and/or have hard-coded your editor’s flake8 configuration then you may wish to update those configurations.

---

<div class="post-metadata">

**Author:** ![jsick](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/jsick/32/672_2.png) [@jsick](https://www.rubin.community/u/jsick)\
**Post date:** [January 24, 2020, 3:29pm UTC](https://www.rubin.community/t/the-rules-for-breaking-long-python-lines-is-changing/4005/2 "2020-01-24T15:29:49Z")

</div>

The relevant sections of the Python Style Guide that changed are:

- [Exceptions to PEP 8](https://developer.lsst.io/python/style.html#exceptions-to-pep-8)
- [Flake8 configuration files](https://developer.lsst.io/python/style.html#flake8-configuration-files)
- [autopep8 MAY be used to fix PEP 8 compliance](https://developer.lsst.io/python/style.html#autopep8-may-be-used-to-fix-pep-8-compliance)
- [Wrap lines before binary operators](https://developer.lsst.io/python/style.html#id21)
