Tag: Channel Specials
-
Using timeit and perf to benchmark Python code
This guide explores the practical use of Python’s built-in timeit module and the powerful perf library for accurate benchmarking. Learn how to perform reproducible, statistically robust performance testing using both tools, interpret their results, and integrate them into modern engineering workflows.
-
Best practices: avoid mutable default arguments
Mutable default arguments in Python can lead to unpredictable bugs because they are evaluated once at function definition, not at each call. This post explains why this happens, demonstrates real-world implications, and provides modern best practices, tools, and patterns to avoid these issues safely.
