Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cleanup/Ruff: Use identity comparison for type/class checks (E721, E712) - #3802

Open
ThomasLecocq wants to merge 1 commit into
masterfrom
fix_type_comparison
Open

Cleanup/Ruff: Use identity comparison for type/class checks (E721, E712)#3802
ThomasLecocq wants to merge 1 commit into
masterfrom
fix_type_comparison

Conversation

@ThomasLecocq

@ThomasLecocq ThomasLecocq commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Replace ==/!= comparisons against type and class objects with is/is not across source and tests, and drop the redundant True == in two SEGY roundtrip assertions.

The left operand in every case is already a type or class object (param_type, convert_to, quantity_type, parsed WADL parameter types, warning .category classes), so identity comparison is behaviour- preserving for these singletons while clearing ruff E721/E712.

No isinstance() conversion is used: it would change semantics by accepting subclasses, which none of these sites intend.

AI used?

DJ Claude

PR Checklist

Replace `==`/`!=` comparisons against type and class objects with
`is`/`is not` across source and tests, and drop the redundant
`True ==` in two SEGY roundtrip assertions.

The left operand in every case is already a type or class object
(param_type, convert_to, quantity_type, parsed WADL parameter types,
warning `.category` classes), so identity comparison is behaviour-
preserving for these singletons while clearing ruff E721/E712.

No isinstance() conversion is used: it would change semantics by
accepting subclasses, which none of these sites intend.
@ThomasLecocq
ThomasLecocq requested a review from megies September 1, 2026 13:19
@ThomasLecocq ThomasLecocq added ready for review PRs that are ready to be reviewed to get marked ready to merge testing issues generally related to our testing setup / infrastructure labels Sep 1, 2026
@ThomasLecocq ThomasLecocq added this to the 1.6.0 milestone Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PRs that are ready to be reviewed to get marked ready to merge testing issues generally related to our testing setup / infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant