Rate limiting examples execute long-running demos during import
The Python rate limiting examples run their demonstration loops at module scope instead of under the standard main guard. For example, implementations/python/rate_limiting/fixed_window_counter.py executes 10 requests, sleeps between them, and then sleeps for 60 seconds whenever the module is imported. The sliding_window_log example also sleeps for 60 seconds at import time. Reproduction: run python -c import time; time.sleep=lambda _: None; import implementations.python.rate_limiting.fixed_window_counter. The import prints the demo output, proving that importing the class has side effects. With normal sleep, the fixed-window import waits through the demonstration, including the 60-second sleep. Expected behavior: keep the examples runnable when invoked directly, but make importing the classes immediate and side-effect free by moving demo code under a standard main guard or separate example scripts.
Source: ashishps1/awesome-system-design-resources