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

Assorted minor code improvements #369

Merged
merged 1 commit into from
May 8, 2023
Merged

Assorted minor code improvements #369

merged 1 commit into from
May 8, 2023

Conversation

jwodder
Copy link
Collaborator

@jwodder jwodder commented May 5, 2023

Part of #325.

My thanks to pylint for helping me find these.

@jwodder jwodder added cleanup internal Changes only affect the internal API labels May 5, 2023
return True
else:
return False
return bool(uuid in self._acquisition_objects)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me is curious:

in principle even bool isn't needed, since in would return bool ,right?

Suggested change
return bool(uuid in self._acquisition_objects)
return uuid in self._acquisition_objects

or that is really to guarantee it if somehow self._acquisition_objects overloads some operator and returns smth else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just following what Pylint suggested, though given how mypy is with the return type of == on arbitrary types, I wouldn't be surprised if it complained about the lack of bool() here as well.

@yarikoptic
Copy link
Member

I am happy to see Python code becoming more pythonic ;) Thank you @jwodder ! Let's proceed. One comment is just for my own sake

@yarikoptic yarikoptic merged commit c0fbdbd into master May 8, 2023
@yarikoptic yarikoptic deleted the assorted branch May 8, 2023 19:10
@github-actions
Copy link

🚀 PR was released in v4.0.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup internal Changes only affect the internal API released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants