Show More
@@ -442,17 +442,17 b' class Inspector:' | |||
|
442 | 442 | if formatter: |
|
443 | 443 | ds = formatter(ds) |
|
444 | 444 | if ds: |
|
445 |
lines.append(head("Class |
|
|
445 | lines.append(head("Class docstring:")) | |
|
446 | 446 | lines.append(indent(ds)) |
|
447 | 447 | if inspect.isclass(obj) and hasattr(obj, '__init__'): |
|
448 | 448 | init_ds = getdoc(obj.__init__) |
|
449 | 449 | if init_ds is not None: |
|
450 |
lines.append(head("Init |
|
|
450 | lines.append(head("Init docstring:")) | |
|
451 | 451 | lines.append(indent(init_ds)) |
|
452 | 452 | elif hasattr(obj,'__call__'): |
|
453 | 453 | call_ds = getdoc(obj.__call__) |
|
454 | 454 | if call_ds: |
|
455 |
lines.append(head("Call |
|
|
455 | lines.append(head("Call docstring:")) | |
|
456 | 456 | lines.append(indent(call_ds)) |
|
457 | 457 | |
|
458 | 458 | if not lines: |
@@ -521,7 +521,7 b' class Inspector:' | |||
|
521 | 521 | pinfo_fields1 = [("Type", "type_name"), |
|
522 | 522 | ] |
|
523 | 523 | |
|
524 |
pinfo_fields2 = [("String |
|
|
524 | pinfo_fields2 = [("String form", "string_form"), | |
|
525 | 525 | ] |
|
526 | 526 | |
|
527 | 527 | pinfo_fields3 = [("Length", "length"), |
@@ -529,8 +529,8 b' class Inspector:' | |||
|
529 | 529 | ("Definition", "definition"), |
|
530 | 530 | ] |
|
531 | 531 | |
|
532 |
pinfo_fields_obj = [("Class |
|
|
533 |
("Init |
|
|
532 | pinfo_fields_obj = [("Class docstring", "class_docstring"), | |
|
533 | ("Init docstring", "init_docstring"), | |
|
534 | 534 | ("Call def", "call_def"), |
|
535 | 535 | ("Call docstring", "call_docstring")] |
|
536 | 536 | |
@@ -571,7 +571,7 b' class Inspector:' | |||
|
571 | 571 | |
|
572 | 572 | add_fields(self.pinfo_fields3) |
|
573 | 573 | if info['isclass'] and info['init_definition']: |
|
574 |
displayfields.append(("Init |
|
|
574 | displayfields.append(("Init definition", | |
|
575 | 575 | info['init_definition'].rstrip())) |
|
576 | 576 | |
|
577 | 577 | # Source or docstring, depending on detail level and whether |
@@ -585,7 +585,7 b' class Inspector:' | |||
|
585 | 585 | # Constructor info for classes |
|
586 | 586 | if info['isclass']: |
|
587 | 587 | if info['init_docstring'] is not None: |
|
588 |
displayfields.append(("Init |
|
|
588 | displayfields.append(("Init docstring", | |
|
589 | 589 | info['init_docstring'])) |
|
590 | 590 | |
|
591 | 591 | # Info for objects: |
@@ -114,16 +114,16 b' def test_ipdb_magics():' | |||
|
114 | 114 | ipdb> pdef example_function |
|
115 | 115 | example_function(x, y, z='hello') |
|
116 | 116 | ipdb> pdoc ExampleClass |
|
117 |
Class |
|
|
117 | Class docstring: | |
|
118 | 118 | Docstring for ExampleClass. |
|
119 |
Init |
|
|
119 | Init docstring: | |
|
120 | 120 | Docstring for ExampleClass.__init__ |
|
121 | 121 | ipdb> pinfo a |
|
122 | 122 | Type: ExampleClass |
|
123 |
String |
|
|
123 | String form: ExampleClass() | |
|
124 | 124 | Namespace: Local... |
|
125 | 125 | Docstring: Docstring for ExampleClass. |
|
126 |
Init |
|
|
126 | Init docstring: Docstring for ExampleClass.__init__ | |
|
127 | 127 | ipdb> continue |
|
128 | 128 | |
|
129 | 129 | Restore previous trace function, e.g. for coverage.py |
General Comments 0
You need to be logged in to leave comments.
Login now