Skip to content

Update type comparison #246

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Nov 17, 2022

  • Updated type comparison to ones that are more idiomatic and understood by type-checkers
    • getattr instead of hasattr when applicable
    • isinstance(x) instead of type(x) ==
  • is None instead of == None
  • set_cooler_manual_control_enabled was comparing a bool against 1. Which is redundant.

@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2022

Codecov Report

Merging #246 (9cb486a) into master (4e8bbf8) will not change coverage.
The diff coverage is 69.23%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #246   +/-   ##
=======================================
  Coverage   78.21%   78.21%           
=======================================
  Files          42       42           
  Lines        4705     4705           
=======================================
  Hits         3680     3680           
  Misses       1025     1025           

@vasily-v-ryabov
Copy link
Collaborator

Please resolve conflicts.

@Avasam
Copy link
Contributor Author

Avasam commented Jul 8, 2023

@vasily-v-ryabov Conflicts has been resolved. Could I get a review on this?

@Avasam
Copy link
Contributor Author

Avasam commented Aug 18, 2024

@python-xlib @vasily-v-ryabov bump

Updated type comparison to one that is understood by type-checkers
- `is None` instead of `== None`
- `set_cooler_manual_control_enabled` was comparing a bool agains `1`. Which would always return `False`
- `getattr` instead of `hasattr` when applicable
@Avasam Avasam force-pushed the type-comparisons branch from 855dd10 to c962168 Compare April 11, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants