fix: Don't omit optional parentheses for subscripts (#7380)

This commit is contained in:
Micha Reiser 2023-09-14 10:43:53 +02:00 committed by GitHub
parent 04183b0299
commit a65efcf459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 50 deletions

View file

@ -91,3 +91,10 @@ f = "f"[:,]
g1 = "g"[(1):(2)]
g2 = "g"[(1):(2):(3)]
# Don't omit optional parentheses for subscripts
# https://github.com/astral-sh/ruff/issues/7319
def f():
return (
package_version is not None
and package_version.split(".")[:2] == package_info.version.split(".")[:2]
)