Describe the bug
Slicing of bracketed expressions is broken by too eager removal of the brackets.
To Reproduce
- Try to reformat a file containing
return ('%x' % value)[-12:]
- The resulting expression is not producing equivalent result:
return '%x' % mac[-12:]
Expected behavior
Expected to not remove the brackets in this case.
Environment (please complete the following information):
- Version: master
- OS and Python version: Linux, Python 3.7.4
Does this bug also happen on master? To answer this, you have two options:
Yes.