Skip to content

Slicing of bracketed expressions is broken by removal of the brackets #1575

@michael-sayapin

Description

@michael-sayapin

Describe the bug

Slicing of bracketed expressions is broken by too eager removal of the brackets.

To Reproduce

  1. Try to reformat a file containing return ('%x' % value)[-12:]
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions