Skip to content

Instantly share code, notes, and snippets.

View Arfey's full-sized avatar
🇺🇦

Mykhailo Havelia Arfey

🇺🇦
  • Kyiv
  • 18:44 (UTC -12:00)
View GitHub Profile
#### work
import typing as t
import asyncio
RateResult = t.Callable[..., t.Coroutine[t.Any, t.Any, None]]
def rate_limit_builder(count_limit: int, time_period: int) -> RateResult:
@Arfey
Arfey / main.py
Last active April 21, 2026 10:56
nogil example with if expression as key value
import sys, time, threading
test_dict = {i: None for i in range(1000)}
ITERS = 1_000_000
def reader(d, expression):
keys = list(d.keys())
n = len(keys)
for i in range(ITERS):
if expression: