---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP038 [*] Use `X | Y` in `isinstance` call instead of `(X, Y)`
 --> UP038.py:1:1
  |
1 | isinstance(1, (int, float))  # UP038
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | issubclass("yes", (int, float, str))  # UP038
  |
help: Convert to `X | Y`
  |
  - isinstance(1, (int, float))  # UP038
1 + isinstance(1, int | float)  # UP038
2 | issubclass("yes", (int, float, str))  # UP038
  |
note: This is an unsafe fix and may change runtime behavior

UP038 [*] Use `X | Y` in `issubclass` call instead of `(X, Y)`
 --> UP038.py:2:1
  |
1 | isinstance(1, (int, float))  # UP038
2 | issubclass("yes", (int, float, str))  # UP038
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 |
4 | isinstance(1, int)  # OK
  |
help: Convert to `X | Y`
  |
1 | isinstance(1, (int, float))  # UP038
  - issubclass("yes", (int, float, str))  # UP038
2 + issubclass("yes", int | float | str)  # UP038
3 |
  |
note: This is an unsafe fix and may change runtime behavior
