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

Make typing less strict #155

Merged
merged 4 commits into from
Sep 1, 2022
Merged

Make typing less strict #155

merged 4 commits into from
Sep 1, 2022

Conversation

SethMMorton
Copy link
Owner

Closes #154.

This MR aims to make natsort functions accept a wider variety of types when type-checking, which is more reflective of reality.

...and to some degree private as well.

Previously, the declared hints for natsort were too restrictive.
Generics and protocols are now utilized to make the type hints more
"open" which is more realistic, since more than just basic types can be
sorted.
This way we don't need to use casts in-code.
@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Base: 96.79% // Head: 98.44% // Increases project coverage by +1.64% 🎉

Coverage data is based on head (24b6b81) compared to base (e5d2e45).
Patch coverage: 92.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
+ Coverage   96.79%   98.44%   +1.64%     
==========================================
  Files          10       10              
  Lines         624      578      -46     
==========================================
- Hits          604      569      -35     
+ Misses         20        9      -11     
Impacted Files Coverage Δ
natsort/utils.py 97.22% <86.36%> (-1.18%) ⬇️
natsort/compat/locale.py 97.87% <100.00%> (ø)
natsort/natsort.py 100.00% <100.00%> (+9.52%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@SethMMorton SethMMorton merged commit 5c52a88 into master Sep 1, 2022
@SethMMorton SethMMorton deleted the make-typing-less-strict branch September 1, 2022 21:37
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.

Loosen types and type checking
1 participant