-
-
Notifications
You must be signed in to change notification settings - Fork 76
Attempt to improve liskov substitution principle error #128
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
Attempt to improve liskov substitution principle error #128
Conversation
Thanks @daehan-koreapool for initiating this convo! Not sure why it is complaining line 21. The return type ( Regarding line 25, it makes sense to change the type of |
I tried making bunch of changes on Returning
|
Thanks @daehan-koreapool , changing Primitive to a union type makes sense to me. |
UPDATE: include serialization.py in mypy test UPDATE: Primitive is a union type now UPDATE: f-string formatted values are explicitly converted into strings REMOVE: field_sorter() had no real usage UPDATE: from_primitive() takes a generalized Primitive value UPDATE: narrow Primitive value type within from_primitive() FIX: BlockFrostChainContext constructor to have an empty string default value
Codecov Report
@@ Coverage Diff @@
## main #128 +/- ##
==========================================
+ Coverage 85.92% 85.95% +0.02%
==========================================
Files 25 25
Lines 2693 2698 +5
Branches 518 519 +1
==========================================
+ Hits 2314 2319 +5
+ Misses 286 285 -1
- Partials 93 94 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as always. Thank you @daehan-koreapool !
Background
CBORSerializable
tend to override primitive related methods with tighter and specific parameter and return value types.CBORSerializable
subclasses andnetwork.py
module is the smallest module demonstrating the problem.Goal