0x343 Python

Summary of python, cython

Control Flow

Iterable, Iterator and Generator

Iterable: An object which can generator iterator. In python, either __iter__ or __getitem__should be implemented to be an Iterable

Iterator: An object that implement __next__ and raise StopIteration when items exhausted

Generator: simple lazy iterator, any function using coroutine yield

use itertools library

Reference

[1] Ramalho, Luciano. Fluent Python: clear, concise, and effective programming. ” O’Reilly Media, Inc.”, 2015.