-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return list[str] when passed multiple values from python (#53)
<!-- Generated by sourcery-ai[bot]: start summary --> ## Summary by Sourcery This pull request introduces a new return type for the `fizzbuzz` function, allowing it to return either a single string or a list of strings based on the input. The documentation and tests have been updated accordingly to reflect these changes. * **Enhancements**: - Updated the `fizzbuzzo3.fizzbuzz` function to return a list of strings when passed a list or range of numbers, instead of a single concatenated string. - Enhanced the documentation to reflect the new return types for the `fizzbuzz` function, providing clearer examples and explanations. - fizzbuzzo3: Introduced a new return type `FizzBuzzReturn` to handle different return types for the `fizzbuzz` function, allowing it to return either a single string or a list of strings based on the input. * **Documentation**: - Added detailed documentation on how to implement and use the new `FizzBuzzReturn` type in `docs/dev-build.md`. - Updated the type hints and docstrings in `python/fizzbuzz/fizzbuzzo3.pyi` to reflect the new return types for the `fizzbuzz` function. * **Tests**: - Modified existing tests to check for the new return type (list of strings) when passing a list or range of numbers to the `fizzbuzz` function. - Added new test cases to ensure the `fizzbuzz` function returns an empty list for invalid slice ranges. * **Chores**: - Commented out the Python performance tests in `tests/perftest.py` to focus on Rust performance comparisons. <!-- Generated by sourcery-ai[bot]: end summary -->
- Loading branch information
1 parent
9ad7d82
commit 732d1a1
Showing
6 changed files
with
285 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.