Skip to content

Commit

Permalink
Fix pre-commit error on master (TheAlgorithms#3992)
Browse files Browse the repository at this point in the history
* Update pigeon_sort.py

* updating DIRECTORY.md

* Add type hints and return annotation

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
  • Loading branch information
dhruvmanila and github-actions authored Nov 30, 2020
1 parent 07a4ce9 commit f8b2c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
* [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py)

## Electronics
* [Electric Power](https://github.com/TheAlgorithms/Python/blob/master/electronics/electric_power.py)
* [Ohms Law](https://github.com/TheAlgorithms/Python/blob/master/electronics/ohms_law.py)

## File Transfer
Expand Down
4 changes: 3 additions & 1 deletion sorts/pigeon_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
For manual testing run:
python pigeon_sort.py
"""
from typing import List


def pigeon_sort(array):
def pigeon_sort(array: List[int]) -> List[int]:
"""
Implementation of pigeon hole sort algorithm
:param array: Collection of comparable items
Expand Down Expand Up @@ -52,6 +53,7 @@ def pigeon_sort(array):

if __name__ == "__main__":
import doctest

doctest.testmod()
user_input = input("Enter numbers separated by comma:\n")
unsorted = [int(x) for x in user_input.split(",")]
Expand Down

0 comments on commit f8b2c43

Please sign in to comment.