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

Typing corrections #109

Merged
merged 3 commits into from
Jul 7, 2024
Merged

Conversation

yodaldevoid
Copy link
Contributor

Corrects a some incorrect typing information in the smbus2.pyi file compared to smbus2.py.

  • SMBus.fd int to Optional[int]
  • SMBus.force Optional[bool] to bool
  • enable parameter of SMBus.enable_pec has a default value

At initialization SMBus.fd is None making the correct typing
Optional[int].
enable_pec's enable parameter has a default value that was not captured
in the typing information.
SMBus.force is never set to None unless a user manually sets it as such.
Additionally, no logic checks if SMBus.force is None, only if it is
True, making False and None equivalent in this case.
Copy link

sonarqubecloud bot commented May 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Owner

@kplindegaard kplindegaard left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kplindegaard kplindegaard merged commit 865af1e into kplindegaard:master Jul 7, 2024
1 check passed
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.

2 participants