##// END OF EJS Templates
Neater code using getattr, as suggested by MinRK.
Thomas Kluyver -
Show More
@@ -662,10 +662,8 b' class Inspector:'
662 662 # from its __call__ method.
663 663
664 664 if inspect.isclass(obj):
665 try:
666 callable_obj = obj.__init__
667 except AttributeError:
668 callable_obj = None
665 # Old-style classes need not have an __init__
666 callable_obj = getattr(obj, "__init__", None)
669 667 elif callable(obj):
670 668 callable_obj = obj
671 669 else:
General Comments 0
You need to be logged in to leave comments. Login now