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

[Style] Use isinstance() rather than type() for a typecheck. #80

Closed
1 task done
Zerohertz opened this issue Nov 19, 2023 · 0 comments · Fixed by #81
Closed
1 task done

[Style] Use isinstance() rather than type() for a typecheck. #80

Zerohertz opened this issue Nov 19, 2023 · 0 comments · Fixed by #81
Assignees
Labels
style Code styles

Comments

@Zerohertz
Copy link
Owner

Zerohertz commented Nov 19, 2023

Problem Definition

codacy

Use isinstance() rather than type() for a typecheck. The idiomatic way to perform an explicit typecheck in Python is to use isinstance(x, Y) rather than type(x) == Y, type(x) is Y. Though there are unusual situations where these give different results.

Use isinstance() rather than type() for a typecheck. The idiomatic way to perform an explicit typecheck in Python is to use isinstance(x, Y) rather than type(x) == Y, type(x) is Y. Though there are unusual situations where these give different results.

To Do

@Zerohertz Zerohertz self-assigned this Nov 19, 2023
@Zerohertz Zerohertz added the style Code styles label Nov 19, 2023
Zerohertz added a commit that referenced this issue Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style Code styles
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant