ham[lower + offset : upper + offset]
ruff --fix --select E203 bug.py (v0.0.287) gives
ham[lower + offset: upper + offset]
which is discouraged by PEP 8:
However, in a slice the colon acts like a binary operator, and should have equal amounts on either side (treating it as the operator with the lowest priority).
https://peps.python.org/pep-0008/#pet-peeves
So, ham[lower + offset: upper + offset] is incorrect. I would argue that ham[lower + offset : upper + offset] (which is what black outputs) should not be flagged by E203; and if so, both spaces should be removed (but I still argue to remove none at all).