Show More
@@ -22,7 +22,7 b' import os' | |||
|
22 | 22 | from textwrap import dedent |
|
23 | 23 | import types |
|
24 | 24 | import io as stdlib_io |
|
25 |
from itertools import zip_longest |
|
|
25 | from itertools import zip_longest | |
|
26 | 26 | |
|
27 | 27 | # IPython's own |
|
28 | 28 | from IPython.core import page |
@@ -203,7 +203,7 b' def is_simple_callable(obj):' | |||
|
203 | 203 | def getargspec(obj): |
|
204 | 204 | """Wrapper around :func:`inspect.getfullargspec` on Python 3, and |
|
205 | 205 | :func:inspect.getargspec` on Python 2. |
|
206 | ||
|
206 | ||
|
207 | 207 | In addition to functions and methods, this can also handle objects with a |
|
208 | 208 | ``__call__`` attribute. |
|
209 | 209 | """ |
@@ -327,7 +327,7 b' def find_source_lines(obj):' | |||
|
327 | 327 | The line number where the object definition starts. |
|
328 | 328 | """ |
|
329 | 329 | obj = _get_wrapped(obj) |
|
330 | ||
|
330 | ||
|
331 | 331 | try: |
|
332 | 332 | try: |
|
333 | 333 | lineno = inspect.getsourcelines(obj)[1] |
@@ -582,7 +582,7 b' class Inspector(Colorable):' | |||
|
582 | 582 | |
|
583 | 583 | def _get_info(self, obj, oname='', formatter=None, info=None, detail_level=0): |
|
584 | 584 | """Retrieve an info dict and format it. |
|
585 | ||
|
585 | ||
|
586 | 586 | Parameters |
|
587 | 587 | ========== |
|
588 | 588 | |
@@ -639,6 +639,7 b' class Inspector(Colorable):' | |||
|
639 | 639 | |
|
640 | 640 | append_field(_mime, 'File', 'file') |
|
641 | 641 | append_field(_mime, 'Type', 'type_name') |
|
642 | append_field(_mime, 'Subclasses', 'subclasses') | |
|
642 | 643 | |
|
643 | 644 | else: |
|
644 | 645 | # General Python objects |
@@ -653,7 +654,7 b' class Inspector(Colorable):' | |||
|
653 | 654 | |
|
654 | 655 | append_field(_mime, 'Length', 'length') |
|
655 | 656 | append_field(_mime, 'File', 'file') |
|
656 | ||
|
657 | ||
|
657 | 658 | # Source or docstring, depending on detail level and whether |
|
658 | 659 | # source found. |
|
659 | 660 | if detail_level > 0 and info['source']: |
@@ -664,7 +665,7 b' class Inspector(Colorable):' | |||
|
664 | 665 | append_field(_mime, 'Class docstring', 'class_docstring', formatter) |
|
665 | 666 | append_field(_mime, 'Init docstring', 'init_docstring', formatter) |
|
666 | 667 | append_field(_mime, 'Call docstring', 'call_docstring', formatter) |
|
667 | ||
|
668 | ||
|
668 | 669 | |
|
669 | 670 | return self.format_mime(_mime) |
|
670 | 671 | |
@@ -859,6 +860,9 b' class Inspector(Colorable):' | |||
|
859 | 860 | if init_ds: |
|
860 | 861 | out['init_docstring'] = init_ds |
|
861 | 862 | |
|
863 | names = [sub.__name__ for sub in obj.__subclasses__()] | |
|
864 | all_names = ', '.join(names) | |
|
865 | out['subclasses'] = all_names | |
|
862 | 866 | # and class docstring for instances: |
|
863 | 867 | else: |
|
864 | 868 | # reconstruct the function definition and print it: |
General Comments 0
You need to be logged in to leave comments.
Login now