---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/cases/comments_in_double_parens.py
---
## Input

```python
if (
    True
    # sdf
):
    print("hw")

if ((
    True
    # sdf
)):
    print("hw")

if ((
    # type: ignore
    True
)):
    print("hw")

if ((
    True
    # type: ignore
)):
    print("hw")

if (
    # a long comment about
    # the condition below
    (a or b)
):
    pass

def return_true():
    return (
        (
            True  # this comment gets removed accidentally
        )
    )

def return_true():
    return (True)  # this comment gets removed accidentally


if (
    # huh comment
    (True)
):
    ...

if (
    # huh
    (
        # comment
        True
    )
):
    ...
```

## Black Differences

```diff
--- Black
+++ Ruff
@@ -25,8 +25,7 @@
 if (
     # a long comment about
     # the condition below
-    a
-    or b
+    a or b
 ):
     pass
 
```

## Ruff Output

```python
if (
    True
    # sdf
):
    print("hw")

if (
    True
    # sdf
):
    print("hw")

if (
    # type: ignore
    True
):
    print("hw")

if (
    True
    # type: ignore
):
    print("hw")

if (
    # a long comment about
    # the condition below
    a or b
):
    pass


def return_true():
    return True  # this comment gets removed accidentally


def return_true():
    return True  # this comment gets removed accidentally


if (
    # huh comment
    True
):
    ...

if (
    # huh
    # comment
    True
):
    ...
```

## Black Output

```python
if (
    True
    # sdf
):
    print("hw")

if (
    True
    # sdf
):
    print("hw")

if (
    # type: ignore
    True
):
    print("hw")

if (
    True
    # type: ignore
):
    print("hw")

if (
    # a long comment about
    # the condition below
    a
    or b
):
    pass


def return_true():
    return True  # this comment gets removed accidentally


def return_true():
    return True  # this comment gets removed accidentally


if (
    # huh comment
    True
):
    ...

if (
    # huh
    # comment
    True
):
    ...
```
