🎨 Just improving logic structure. #6351
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While I'm not so sure, whether you can accept such PR or not.
In the meanwhile, I'm trying to fix #6327. I sent the PR #6333.
However, at that moment, I didn't figure out the correct way of testing. I realized the previous PR is far from robustness. Thus I feel I need analyze the code firstly and then think to improve the code to workaround it.
During the analysis of the code, I have felt the original code is not somehow elegant.
In the original
if not isinstance(....):
A
else:
B
But I believe
if isinstance(...):
B
else:
A
is much simpler and easy to read.
This PR is just change to the above. No essential change.
I'm afraid the original authors' feel such change is needless. But I believe for further analysis by many contributors such revision would be works good.
Could you please think about acceptance?