clarete / forbiddenfruit

Patch built-in python objects

Home Page:https://clarete.li/forbiddenfruit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to curse __call__

MrFizzyBubbs opened this issue · comments

Attempting to curse the __call__ method results in a KeyError. Minimum working example below.

def wrap(func):
    def wrapped(*args, **kwargs):
      print("intercepted")
      return func(*args, **kwargs)
    return wrapped

curse(int, "__call__", wrap(int.__call__))