mirror of https://github.com/astral-sh/ruff
This PR resolved #15772 Before PR: ``` def _( this_is_fine: int = f(), # No error this_is_not: list[int] = f() # B008: Do not perform function call `f` in argument defaults ): ... @dataclass class _: this_is_not_fine: list[int] = f() # RUF009: Do not perform function call `f` in dataclass defaults this_is_also_not: int = f() # RUF009: Do not perform function call `f` in dataclass defaults ``` After PR: ``` def _( this_is_fine: int = f(), # No error this_is_not: list[int] = f() # B008: Do not perform function call `f` in argument defaults ): ... @dataclass class _: this_is_not_fine: list[int] = f() # RUF009: Do not perform function call `f` in dataclass defaults this_is_fine: int = f() ``` |
||
|---|---|---|
| .. | ||
| test | ||
| __init__.py | ||