Skip to content

Commit e5617b8

Browse files
authored
Added Documentation to Empty List Testing (#50)
* Documented testing * Added yet more documentation
1 parent a2ce4f0 commit e5617b8

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

testing/how_to_empty_a_list.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
"""
2-
Test the performance of all of the solutions listed in the following article:
2+
Tests the performance of all of the solutions listed in the following article:
33
https://therenegadecoder.com/code/how-to-empty-a-list-in-python/
44
"""
55

66
from test_bench import test_bench
77

8-
def control(anime):
8+
def control(anime: list(str)) -> None:
9+
"""
10+
Provides a control scenario for testing. In this case, all of the solutions
11+
rely on copying the input list, so the control function accounts for that.
12+
13+
:param anime: a list of anime
14+
"""
915
anime = anime.copy()
1016

11-
def empty_list_by_hand(anime):
17+
def empty_list_by_hand(anime: list(str)) -> None:
18+
"""
19+
Tests the performance of emptying a list by hand.
20+
21+
:param anime: a list of anime
22+
"""
1223
anime = anime.copy()
1324
while anime:
1425
anime.pop()

0 commit comments

Comments
 (0)