/
Pac_Lord
/
homework_decorators
Обзор
Документация
Войти
/
Pac_Lord
/
homework_decorators
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
task_3.py
30 строк
772 B
Pac_Lord
initial commit
16 май 2026, 09:10
16 май 2026, 09:10
0a5a99e
Код
Авторство
О чём код?
import types from task_2 import logger_path @logger_path('flat_generator.log') def flat_generator(list_of_lists): for sublist in list_of_lists: for item in sublist: yield item def test_2(): list_of_lists_1 = [ ['a', 'b', 'c'], ['d', 'e', 'f', 'h', False], [1, 2, None] ] for flat_iterator_item, check_item in zip( flat_generator(list_of_lists_1), ['a', 'b', 'c', 'd', 'e', 'f', 'h', False, 1, 2, None] ): assert flat_iterator_item == check_item assert list(flat_generator(list_of_lists_1)) == ['a', 'b', 'c', 'd', 'e', 'f', 'h', False, 1, 2, None] assert isinstance(flat_generator(list_of_lists_1), types.GeneratorType) if __name__ == '__main__': test_2()