We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cac566c commit a1e52e1Copy full SHA for a1e52e1
bpython/inspection.py
@@ -209,7 +209,12 @@ def getpydocspec(f, func):
209
210
211
def getargspec(func, f):
212
- is_bound_method = inspect.ismethod(f) and f.im_self is not None
+ # Check if it's a real bound method or if it's implicitly calling __init__
213
+ # (i.e. FooClass(...) and not FooClass.__init__(...) -- the former would
214
+ # not take 'self', the latter would:
215
+ is_bound_method = ((inspect.ismethod(f) and f.im_self is not None)
216
+ or (f.__name__ == '__init__' and not
217
+ func.endswith('.__init__')))
218
try:
219
if py3:
220
argspec = inspect.getfullargspec(f)
0 commit comments