-
-
Notifications
You must be signed in to change notification settings - Fork 41
Fixed Spinner frame type hint issue. #261
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
Conversation
This fixes any type errors raised when passing some list object to `Spinner`. closes pavdmyt#260
|
|
Relevant mypy errorMy initial call was right. I changed it back to @dataclass
class Spinner:
frames: str | list[str]
interval: intand the mypy checks pass. Should I set it like this for now or should I edit the source code further to accommodate the |
|
Let's use To make # TODO (pavdmyt): support any type that implements iterable
- if isinstance(spinner.frames, list | tuple):
+ if isinstance(spinner.frames, Sequence): |
`frames` is now `Sequence[str]` mypy checks pass
|
I was scared to update the original checks but since I got the go, here you go! pytests and mypy checks pass |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #261 +/- ##
=======================================
Coverage 94.68% 94.68%
=======================================
Files 5 5
Lines 414 414
=======================================
Hits 392 392
Misses 22 22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@AbdelRahmanRahal thanks for you contribution 👍🏼 This will be included into the next yaspin release. |
This fixes any type errors raised when passing some list object to
Spinner.All tests that aren't skipped pass. 1 unrelated warning.
See tests output
closes #260