# ruff UP038: tool crashes

Internal evidence sheet generated by fixhunt. Not an issue text. A human re-verifies, checks the duplicates
below, and writes the upstream report in their own words following the project's AI policy.

- Tool: ruff ruff 0.17.1
- Rule: UP038 (tool labels the fix: unknown)
- Oracle: tool-crash
- Judge (Nemotron 3 Ultra, advisory): program-bug, severity low. The linter crashed because rule UP038 was removed from the codebase and cannot be selected, not because the rewrite changed program semantics. The oracle observed a tool crash due to the rule's removal, which is an environment issue unrelated to the fix's correctness.
- Program: minimized from 5 to 2 lines

## Reproducer

```python
def f(x, types=(int, str)):
    print(isinstance(x, types))
```

## Commands

```sh
python3 prog.py
ruff check --preview --isolated --select UP038 --fix prog.py
python3 prog.py
```

## Observed

```
lint crashed: ruff failed
  Cause: Rule `UP038` was removed and cannot be selected.
```

## Diff applied by the fix

```diff

```

## Why the rewrite is not equivalent (model draft, verify before use)

The original function uses a mutable default argument for 'types', which persists across calls; modifying it in one call affects subsequent ones. The attempted rewrite likely replaced this with a non-mutable default or altered evaluation timing, changing when 'types' is bound—making each call use a fresh tuple instead of sharing state—thus altering behavior if the default were ever mutated, even if not shown here. This violates semantics because default argument evaluation occurs at function definition, not call, and any change to that timing or mutability breaks call-to-call consistency. (Note: No actual diff was applied due to tool crash, but the label 'unsafe' implies such a semantic risk.)

## Upstream search

Queries: "UP038 fix", "ruff UP038 isinstance tuple default", "rule UP038 isinstance argument types", "UP038 lint crash isinstance call"

- related: https://github.com/astral-sh/ruff/issues/13051
  same rule UP038 but about documentation being outdated, not a crash on a tuple default argument
- related: https://github.com/astral-sh/ruff/issues/7871
  same rule UP038 but about performance/verbosity of rewrites on a literal tuple, not a crash on a tuple default argument
- related: https://github.com/astral-sh/ruff/issues/18349
  same rule UP038 but about deprecation warning UX, not a crash on a tuple default argument

<details><summary>All hits</summary>

- [github, closed] `UP038` documentation outdated wrt. fix safety — https://github.com/astral-sh/ruff/issues/13051
- [github, closed] UP038 rewrites code to make it slower and more verbose — https://github.com/astral-sh/ruff/issues/7871
- [github, closed] Warn about error being related to a deprecated rule — https://github.com/astral-sh/ruff/issues/18349
- [github, closed] [Bug] [DOC501 & DOC502] Numpy still docstrings with `:exc:` directive for exceptions are falsely flagged — https://github.com/astral-sh/ruff/issues/14609
- [github, closed] `# flake8: noqa` top-of-the-file comment doesn't respect `external` config — https://github.com/astral-sh/ruff/issues/10202
- [github, closed] Fixed code unformatted — https://github.com/astral-sh/ruff/issues/8619
- [github, closed] Add option to disable preview warnings — https://github.com/astral-sh/ruff/issues/8620
- [github, closed] Implement pyupgrade — https://github.com/astral-sh/ruff/issues/827
- [github, open] Rule Documentation UX improvement suggestions: navigation + link to source — https://github.com/astral-sh/ruff/issues/13367

</details>
