summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/CallTips.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-27 10:40:20 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-27 10:40:20 (GMT)
commitff737954f3ee3005236133fc51b55a508b11aa06 (patch)
treeb65ae9e39e774bd73674b5088e549d09a7bfd7d6 /Lib/idlelib/CallTips.py
parent0d3fb8a944a810f421377d5823cbc006700b3c1d (diff)
downloadcpython-ff737954f3ee3005236133fc51b55a508b11aa06.zip
cpython-ff737954f3ee3005236133fc51b55a508b11aa06.tar.gz
cpython-ff737954f3ee3005236133fc51b55a508b11aa06.tar.bz2
Removed the API to create unbound methods and simplified the API for bound methods. The signature is PyMethod_New(func, instance).
Also removed im_class and renamed im_self to __self__ and im_func to __func__. im_class can be substituted with method.__self__.__class__. I've also updated some parts of the documenation.
Diffstat (limited to 'Lib/idlelib/CallTips.py')
-rw-r--r--Lib/idlelib/CallTips.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/CallTips.py
index aee7e61..cda2be9 100644
--- a/Lib/idlelib/CallTips.py
+++ b/Lib/idlelib/CallTips.py
@@ -116,7 +116,7 @@ class CallTips:
def _find_constructor(class_ob):
"Find the nearest __init__() in the class tree."
try:
- return class_ob.__init__.im_func
+ return class_ob.__init__.__func__
except AttributeError:
for base in class_ob.__bases__:
init = _find_constructor(base)
@@ -133,7 +133,7 @@ def get_argspec(ob):
if fob is None:
fob = lambda: None
elif isinstance(ob, types.MethodType):
- fob = ob.im_func
+ fob = ob.__func__
else:
fob = ob
if isinstance(fob, (types.FunctionType, types.LambdaType)):
@@ -183,7 +183,7 @@ def main():
name = t.__name__
# exercise fetch_tip(), not just get_argspec()
try:
- qualified_name = "%s.%s" % (t.im_class.__name__, name)
+ qualified_name = "%s.%s" % (t.__self__.__class__.__name__, name)
except AttributeError:
qualified_name = name
argspec = ct.fetch_tip(qualified_name)