Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace direct type comparisons with isinstance #760

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Conversation

delatrie
Copy link
Contributor

@delatrie delatrie commented Aug 8, 2023

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