fix: Correct consistency with double [float] number type parsing #457
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.
Description
Fixes #456
This PR fixes 'double' number type parsing, by ensuring that all values documented/intended as 'doubles' in the transmission RPC are returned as 'float's by this library (as they're already currently correctly documented).
This fixes the issue of unintentionally returning 'int' types for these functions which document 'float' return types when the return value is a whole number (particularly
0
or1
). Some functions in the library already did this, but not all of them, so this PR fixes this inconsistency.See the upstream transmission documentation for all parameters which are a 'double' value type which should be returned as 'float's by this library: /~https://github.com/transmission/transmission/blob/main/docs/rpc-spec.md
Testing
I ran all tests (
task lint
andtask test
[note, an__init__.py
file needed to be added to thetests/
directory fortask test
to work]) as well as did a basic sanity check against live usage of this package after these changes.Before these changes:
After these changes: