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

[py2py3] Fix pre-python2.6 idiom: use "isinstance()" instead of "type() == " #10171

Closed
mapellidario opened this issue Dec 11, 2020 · 0 comments · Fixed by #10172
Closed

[py2py3] Fix pre-python2.6 idiom: use "isinstance()" instead of "type() == " #10171

mapellidario opened this issue Dec 11, 2020 · 0 comments · Fixed by #10172

Comments

@mapellidario
Copy link
Member

Impact of the new feature

Likely to involve a large portion of the codebase.

Is your feature request related to a problem? Please describe.

The "python3 compatibility report" section of the Jenkins report often suggests the following change, in order not to use a pre-py2.6 idiom:

- if type(variable) == mytype:
+ if isinstance(variable, mytype):

Since these are almost always safe changes, they can be tackled all at once.

Describe the solution you'd like

We should apply the changes suggested by the "python3 compatibility report" regarding pre-py2.6 idioms once and for all.

Additional context

This issue was suggested in the comments section of #10103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant