summaryrefslogtreecommitdiffstats
path: root/Lib/test/inspect_fodder.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/inspect_fodder.py')
-rw-r--r--Lib/test/inspect_fodder.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/inspect_fodder.py b/Lib/test/inspect_fodder.py
index ff3f0e4..6675077 100644
--- a/Lib/test/inspect_fodder.py
+++ b/Lib/test/inspect_fodder.py
@@ -80,3 +80,14 @@ try:
raise Exception()
except:
tb = sys.exc_info()[2]
+
+class Callable:
+ def __call__(self, *args):
+ return args
+
+ def as_method_of(self, obj):
+ from types import MethodType
+ return MethodType(self, obj)
+
+custom_method = Callable().as_method_of(42)
+del Callable