Skip to content

Instantly share code, notes, and snippets.

View AgarwalPragy's full-sized avatar

Pragy Agarwal AgarwalPragy

View GitHub Profile
from __future__ import annotations
from enum import IntEnum
from typing import Callable, Generic, List, Optional, Tuple, TypeVar
__all__ = ['Event', 'handler', 'EventMetaAction']
class EventMetaAction(IntEnum):
handler_added = 1
@AgarwalPragy
AgarwalPragy / printRecursionTree.py
Last active November 8, 2021 12:19
Python3 decorator for visualizing the recursion tree of a function call
from functools import wraps
import builtins
def printRecursionTree(func):
global _recursiondepth
_print = builtins.print
_recursiondepth = 0
def getpads():
if _recursiondepth == 0: