Extract all doctest examples from the given string, and return them as a list of `Example` objects. Line numbers are 0-based, because it's most common in doctests that nothing interesting appears on the same line as opening triple-quote, and so the firs
(self, string, name='<string>')
| 679 | name, filename, lineno, string) |
| 680 | |
| 681 | def get_examples(self, string, name='<string>'): |
| 682 | """ |
| 683 | Extract all doctest examples from the given string, and return |
| 684 | them as a list of `Example` objects. Line numbers are |
| 685 | 0-based, because it's most common in doctests that nothing |
| 686 | interesting appears on the same line as opening triple-quote, |
| 687 | and so the first interesting line is called \"line 1\" then. |
| 688 | |
| 689 | The optional argument `name` is a name identifying this |
| 690 | string, and is only used for error messages. |
| 691 | """ |
| 692 | return [x for x in self.parse(string, name) |
| 693 | if isinstance(x, Example)] |
| 694 | |
| 695 | def _parse_example(self, m, name, lineno): |
| 696 | """ |