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

```python
type A[T=int] = float
type B[*P=int] = float
type C[*Ts=int] = float
type D[*Ts=*int] = float
type D[something_that_is_very_very_very_long=something_that_is_very_very_very_long] = float
type D[*something_that_is_very_very_very_long=*something_that_is_very_very_very_long] = float
type something_that_is_long[something_that_is_long=something_that_is_long] = something_that_is_long

def simple[T=something_that_is_long](short1: int, short2: str, short3: bytes) -> float:
    pass

def longer[something_that_is_long=something_that_is_long](something_that_is_long: something_that_is_long) -> something_that_is_long:
    pass

def trailing_comma1[T=int,](a: str):
    pass

def trailing_comma2[T=int](a: str,):
    pass
```

## Black Differences

```diff
--- Black
+++ Ruff
@@ -8,20 +8,20 @@
 type D[
     *something_that_is_very_very_very_long = *something_that_is_very_very_very_long
 ] = float
-type something_that_is_long[
-    something_that_is_long = something_that_is_long
-] = something_that_is_long
+type something_that_is_long[something_that_is_long = something_that_is_long] = (
+    something_that_is_long
+)
 
 
-def simple[
-    T = something_that_is_long
-](short1: int, short2: str, short3: bytes) -> float:
+def simple[T = something_that_is_long](
+    short1: int, short2: str, short3: bytes
+) -> float:
     pass
 
 
-def longer[
-    something_that_is_long = something_that_is_long
-](something_that_is_long: something_that_is_long) -> something_that_is_long:
+def longer[something_that_is_long = something_that_is_long](
+    something_that_is_long: something_that_is_long,
+) -> something_that_is_long:
     pass
 
 
@@ -31,7 +31,7 @@
     pass
 
 
-def trailing_comma2[
-    T = int
-](a: str,):
+def trailing_comma2[T = int](
+    a: str,
+):
     pass
```

## Ruff Output

```python
type A[T = int] = float
type B[*P = int] = float
type C[*Ts = int] = float
type D[*Ts = *int] = float
type D[
    something_that_is_very_very_very_long = something_that_is_very_very_very_long
] = float
type D[
    *something_that_is_very_very_very_long = *something_that_is_very_very_very_long
] = float
type something_that_is_long[something_that_is_long = something_that_is_long] = (
    something_that_is_long
)


def simple[T = something_that_is_long](
    short1: int, short2: str, short3: bytes
) -> float:
    pass


def longer[something_that_is_long = something_that_is_long](
    something_that_is_long: something_that_is_long,
) -> something_that_is_long:
    pass


def trailing_comma1[
    T = int,
](a: str):
    pass


def trailing_comma2[T = int](
    a: str,
):
    pass
```

## Black Output

```python
type A[T = int] = float
type B[*P = int] = float
type C[*Ts = int] = float
type D[*Ts = *int] = float
type D[
    something_that_is_very_very_very_long = something_that_is_very_very_very_long
] = float
type D[
    *something_that_is_very_very_very_long = *something_that_is_very_very_very_long
] = float
type something_that_is_long[
    something_that_is_long = something_that_is_long
] = something_that_is_long


def simple[
    T = something_that_is_long
](short1: int, short2: str, short3: bytes) -> float:
    pass


def longer[
    something_that_is_long = something_that_is_long
](something_that_is_long: something_that_is_long) -> something_that_is_long:
    pass


def trailing_comma1[
    T = int,
](a: str):
    pass


def trailing_comma2[
    T = int
](a: str,):
    pass
```
