---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP038.py:1:1: UP038 [*] Use `X | Y` in `isinstance` call instead of `(X, Y)`
  |
1 | isinstance(1, (int, float))  # UP038
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP038
2 | issubclass("yes", (int, float, str))  # UP038
  |
  = help: Convert to `X | Y`

ℹ Unsafe fix
1   |-isinstance(1, (int, float))  # UP038
  1 |+isinstance(1, int | float)  # UP038
2 2 | issubclass("yes", (int, float, str))  # UP038
3 3 | 
4 4 | isinstance(1, int)  # OK

UP038.py:2:1: UP038 [*] Use `X | Y` in `issubclass` call instead of `(X, Y)`
  |
1 | isinstance(1, (int, float))  # UP038
2 | issubclass("yes", (int, float, str))  # UP038
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP038
3 | 
4 | isinstance(1, int)  # OK
  |
  = help: Convert to `X | Y`

ℹ Unsafe fix
1 1 | isinstance(1, (int, float))  # UP038
2   |-issubclass("yes", (int, float, str))  # UP038
  2 |+issubclass("yes", int | float | str)  # UP038
3 3 | 
4 4 | isinstance(1, int)  # OK
5 5 | issubclass("yes", int)  # OK


