Skip to content
Unverified Commit 6417c99b authored by Richard Si's avatar Richard Si Committed by GitHub
Browse files

Hug power operators if its operands are "simple" (#2726)

Since power operators almost always have the highest binding power in expressions, it's often more readable to hug it with its operands. The main exception to this is when its operands are non-trivial in which case the power operator will not hug, the rule for this is the following:

> For power ops, an operand is considered "simple" if it's only a NAME, numeric CONSTANT, or attribute access (chained attribute access is allowed), with or without a preceding unary operator. 

Fixes GH-538.
Closes GH-2095.

diff-shades results: https://gist.github.com/ichard26/ca6c6ad4bd1de5152d95418c8645354b



Co-authored-by: default avatarDiego <dpalma@evernote.com>
Co-authored-by: default avatarFelix Hildén <felix.hilden@gmail.com>
Co-authored-by: default avatarJelle Zijlstra <jelle.zijlstra@gmail.com>
parent 73cb6e77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment