Treat parenthesized power operands as non-simple (#7371)

Closes https://github.com/astral-sh/ruff/issues/7318.
This commit is contained in:
Charlie Marsh 2023-09-14 11:36:21 -04:00 committed by GitHub
parent 2ddea7c657
commit 34c1cb7d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -212,6 +212,11 @@ if (
for user_id in set(target_user_ids) - {u.user_id for u in updates}:
updates.append(UserPresenceState.default(user_id))
# If either operator is parenthesized, use non-simple formatting.
# See: https://github.com/astral-sh/ruff/issues/7318.
10**(2)
10**2
# Keeps parenthesized left hand sides
(
log(self.price / self.strike)
@ -657,6 +662,11 @@ if (
for user_id in set(target_user_ids) - {u.user_id for u in updates}:
updates.append(UserPresenceState.default(user_id))
# If either operator is parenthesized, use non-simple formatting.
# See: https://github.com/astral-sh/ruff/issues/7318.
10 ** (2)
10**2
# Keeps parenthesized left hand sides
(
log(self.price / self.strike)