Skip to content

Instantly share code, notes, and snippets.

@rishabh-ink
Last active March 23, 2019 22:45
Show Gist options
  • Save rishabh-ink/bd252d90de71d5815a90f5a7e7a26f49 to your computer and use it in GitHub Desktop.
Save rishabh-ink/bd252d90de71d5815a90f5a7e7a26f49 to your computer and use it in GitHub Desktop.
Of pytest and lru_cache in Python
from functools import lru_cache
from spells import cast_spell
@lru_cache(maxsize=2)
def levitate(target):
"""
Levitates `target` with the "Wingardium Leviosa" spell.
:param str target: Object that you would like to levitate
:returns: None
"""
cast_spell(spell='Wingardium Leviosa', on=target)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment