---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP003 [*] Use `str` instead of `type(...)`
 --> UP003.py:1:1
  |
1 | type("")
  | ^^^^^^^^
2 | type(b"")
3 | type(0)
  |
help: Replace `type(...)` with `str`
  |
  - type("")
1 + str
2 | type(b"")
  |

UP003 [*] Use `bytes` instead of `type(...)`
 --> UP003.py:2:1
  |
1 | type("")
2 | type(b"")
  | ^^^^^^^^^
3 | type(0)
4 | type(0.0)
  |
help: Replace `type(...)` with `bytes`
  |
1 | type("")
  - type(b"")
2 + bytes
3 | type(0)
  |

UP003 [*] Use `int` instead of `type(...)`
 --> UP003.py:3:1
  |
1 | type("")
2 | type(b"")
3 | type(0)
  | ^^^^^^^
4 | type(0.0)
5 | type(0j)
  |
help: Replace `type(...)` with `int`
  |
2 | type(b"")
  - type(0)
3 + int
4 | type(0.0)
  |

UP003 [*] Use `float` instead of `type(...)`
 --> UP003.py:4:1
  |
2 | type(b"")
3 | type(0)
4 | type(0.0)
  | ^^^^^^^^^
5 | type(0j)
  |
help: Replace `type(...)` with `float`
  |
3 | type(0)
  - type(0.0)
4 + float
5 | type(0j)
  |

UP003 [*] Use `complex` instead of `type(...)`
 --> UP003.py:5:1
  |
3 | type(0)
4 | type(0.0)
5 | type(0j)
  | ^^^^^^^^
6 |
7 | # OK
  |
help: Replace `type(...)` with `complex`
  |
4 | type(0.0)
  - type(0j)
5 + complex
6 |
  |

UP003 [*] Use `str` instead of `type(...)`
  --> UP003.py:14:29
   |
13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722459841
14 | assert isinstance(fullname, type("")is not True)
   |                             ^^^^^^^^
   |
help: Replace `type(...)` with `str`
   |
13 | # Regression test for: https://github.com/astral-sh/ruff/issues/7455#issuecomment-1722459841
   - assert isinstance(fullname, type("")is not True)
14 + assert isinstance(fullname, str is not True)
   |
