The One-Word Change That Made My Code 10,000x Faster
Python's in keyword looks the same everywhere. But its speed varies by orders of magnitude depending on what you're searching.
# Slow: O(n) - checks every element
allowed_users_list = ["alice", "bob", "charlie", ...]
def is_allowed_slow(username):
...
samuelochaba.hashnode.dev2 min read