Skip to content

Instantly share code, notes, and snippets.

Dan Reif CH-DanReif

Block or report user

Report or block CH-DanReif

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@CH-DanReif
CH-DanReif / wtaf.py
Last active Mar 6, 2019
WTAF: Try to grok an arbitrary Python object, as well as one reasonably can. N.b. it tries to call the methods. You own anything you break.
View wtaf.py
import types
from typing import Callable, Dict
def _funcify(obj: object, key: str, hist: Dict) -> str:
"""
Call {obj}.{key}() if possible.
@param hist: A dict that starts empty when we begin enumerating an object.
If this method would otherwise recurse, even in a loop, don't.
You can’t perform that action at this time.