Skip to content

Replace direct type comparisons with isinstance - #760

Merged
delatrie merged 1 commit into
masterfrom
flake8-E721-fix
Aug 8, 2023
Merged

delatrie merged 1 commit into
masterfrom
flake8-E721-fix

Conversation

@delatrie

@delatrie delatrie commented Aug 8, 2023

Copy link
Copy Markdown
Contributor

Context

The linting rule E721 was changed in pycodestyle v2.11 referred by flake8 v6.1.0. See more details here and here.

Now these two forms are acceptable:

isinstance(obj, obj_type)
type(obj) is obj_type

While this one is not:

type(obj) == obj_type

This PR fixes all occurrences of the unacceptable form in the codebase.

@delatrie
delatrie requested a review from skhomuti August 8, 2023 16:01
@delatrie delatrie self-assigned this Aug 8, 2023
@delatrie
delatrie marked this pull request as ready for review August 8, 2023 16:05
@delatrie
delatrie merged commit 200b717 into master Aug 8, 2023
@delatrie
delatrie deleted the flake8-E721-fix branch August 8, 2023 16:19
@delatrie delatrie added theme:core type:internal Change that isn't visible or obvious for end users labels Mar 11, 2024
IvanBuruyane pushed a commit to IvanBuruyane/allure-python that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:core type:internal Change that isn't visible or obvious for end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants