Skip to content

Commit d19b3db

Browse files
committed
Add type anotation to sep parameter (str)
1 parent d595b67 commit d19b3db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compression/huffman.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def traverse_tree(root: Letter | TreeNode, bitstring: str = "") -> list[Letter]:
142142
return letters
143143

144144

145-
def huffman_string(string: str, *, sep=" ") -> str:
145+
def huffman_string(string: str, *, sep: str = " ") -> str:
146146
"""
147147
Return huffman coded string, with
148148
each bitstring separated by sep parameter
@@ -159,7 +159,7 @@ def huffman_string(string: str, *, sep=" ") -> str:
159159
return sep.join(letter_bitstrings[char] for char in string)
160160

161161

162-
def huffman(file_path: str, *, sep=" ", output_file: 'Optional[SupportsWrite[str]]' = None) -> None:
162+
def huffman(file_path: str, *, sep: str = " ", output_file: 'Optional[SupportsWrite[str]]' = None) -> None:
163163
"""
164164
Parse the file, Huffman Code it and print the result
165165
to the given output_file, with each bitstring

0 commit comments

Comments
 (0)