Skip to content

Commit 06497e9

Browse files
authored
Merge pull request davidslater#1 from githubnext/main
Add sortedcontainer
2 parents 0b2ed88 + c53646a commit 06497e9

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# easy_python
2+
23
Very basic python repo with a numpy dependency
4+
5+
## sortedcontainers
6+
7+
Codespaces come with numpy installed, so I've added sortedcontainers to the requirements and tests to require an additional pip install step.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
numpy
2+
sortedcontainers

sorted_functions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from sortedcontainers import SortedList
2+
3+
def sorted_order(x):
4+
s = SortedList(x)
5+
return list(s)

test_sorted_functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from sorted_functions import *
2+
3+
4+
def test_sorted_order():
5+
x = ['e', 'a', 'c', 'd', 'b']
6+
y = sorted_order(x)
7+
assert y == sorted(x) == ['a', 'b', 'c', 'd', 'e']

0 commit comments

Comments
 (0)