add function typing

This commit is contained in:
surister 2019-12-23 14:02:40 +01:00
parent e08c1cbf47
commit adef3b9154

View File

@ -10,6 +10,7 @@ Writes the number of answered questions to STDOUT
import pathlib import pathlib
from sys import stdout from sys import stdout
from typing import List
p = pathlib.Path(__file__).parent.parent.joinpath('README.md') p = pathlib.Path(__file__).parent.parent.joinpath('README.md')
@ -17,7 +18,7 @@ with open(p, 'rb') as f:
file_list = [line.rstrip() for line in f.readlines()] file_list = [line.rstrip() for line in f.readlines()]
def get_question_list(file_list) -> list: def get_question_list(file_list: List[bytes]) -> list:
questions_list = [] questions_list = []
temp = [] temp = []
@ -41,7 +42,7 @@ def get_question_list(file_list) -> list:
return questions_list return questions_list
def get_answered_questions(question_list) -> int: def get_answered_questions(question_list: List[List[bytes]]) -> int:
c = 0 c = 0
for q in question_list: for q in question_list:
index = 0 index = 0