PTHMINT-47: Fix ruff ANN401 #18
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.
This pull request refines type annotations across multiple files to improve type safety and consistency in the codebase. The changes primarily involve replacing the use of
Anywith more specific types such asUnion,object, or structured types likedictandlist. Additionally, some unused imports ofAnywere removed to clean up the code.Type Annotation Improvements:
API Response Enhancements:
get_body_datainsrc/multisafepay/api/base/response/api_response.pyto returnOptional[Union[dict, list]]instead ofOptional[Any]for better specificity.dataand related methods inCustomApiResponseto useOptional[Union[dict, list]]instead ofOptional[Any]. [1] [2]Exception Handling:
get_context_valueinsrc/multisafepay/exception/api.pyto returnOptional[Union[str, int, float, bool, Dict, List]]instead ofAny. [1] [2]Utility Functions:
Anywithobjectin utility functions such asprocess_valueanddict_emptyinsrc/multisafepay/util/dict_utils.py. [1] [2]__get_tax_rate_by_iteminsrc/multisafepay/util/total_amount.pyto returnobjectinstead ofAny. [1] [2]Code Cleanup:
Anyimports from several files, includingsrc/multisafepay/util/dict_utils.py,src/multisafepay/util/total_amount.py, and test files. [1] [2] [3] [4] [5]Configuration Update:
ANN401from theignorelist inpyproject.toml, likely to enforce stricter adherence to type annotation rules.