Operating system: MacOS
Python version: 3.6
Black version: 18.9b0
Does also happen on master: yes
Black is violating pep8 rules while formatting, it's introducing spaces in list slices:
x/api.py:28:47: E203 whitespace before ':'
y/api.py:28:52: E203 whitespace before ':'
2 E203 whitespace before ':'
Original code:
l = [i.name for i in x[_offset: _offset + _limit]]
Transformed code:
l = [i.name for i in x[_offset : _offset + _limit]]
I believe this is correct for slicing:
See https://github.com/ambv/black/issues/280 and https://github.com/PyCQA/pycodestyle/issues/373
Indeed. This is also documented in https://github.com/ambv/black#slices.
Most helpful comment
Indeed. This is also documented in https://github.com/ambv/black#slices.