Skip to content

Instantly share code, notes, and snippets.

View vezeli's full-sized avatar

Velibor Zeli vezeli

View GitHub Profile
"""
The results of the script are used in blog article called
"Revisiting the Mechanism Behind the `for` Statement" hosted at
https://mylette.rs/revisiting-the-mechanism-behind-the-for-statement.
Purpose: The script measures the performance of iterating over all
elements in an iterable with two different implementation methods, namely
using Pythonic and non-Pythonic design patterns. See functions
`loop_pythonic` and `loop_with_indexes` for details.
Requirements: Python version >= 3.3
License: MIT License (see https://opensource.org/licenses/MIT)