From adef3b91546ca4e6c6dad241cd35f2298865d2d0 Mon Sep 17 00:00:00 2001 From: surister Date: Mon, 23 Dec 2019 14:02:40 +0100 Subject: [PATCH] add function typing --- scripts/get_answered_questions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/get_answered_questions.py b/scripts/get_answered_questions.py index 383cff6..cd3bfd4 100644 --- a/scripts/get_answered_questions.py +++ b/scripts/get_answered_questions.py @@ -10,6 +10,7 @@ Writes the number of answered questions to STDOUT import pathlib from sys import stdout +from typing import List 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()] -def get_question_list(file_list) -> list: +def get_question_list(file_list: List[bytes]) -> list: questions_list = [] temp = [] @@ -41,7 +42,7 @@ def get_question_list(file_list) -> list: return questions_list -def get_answered_questions(question_list) -> int: +def get_answered_questions(question_list: List[List[bytes]]) -> int: c = 0 for q in question_list: index = 0