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 first int
(self, string, name='<string>')
| 700 | name, filename, lineno, string) |
| 701 | |
| 702 | def get_examples(self, string, name='<string>'): |
| 703 | """ |
| 704 | Extract all doctest examples from the given string, and return |
| 705 | them as a list of `Example` objects. Line numbers are |
| 706 | 0-based, because it's most common in doctests that nothing |
| 707 | interesting appears on the same line as opening triple-quote, |
| 708 | and so the first interesting line is called \"line 1\" then. |
| 709 | |
| 710 | The optional argument `name` is a name identifying this |
| 711 | string, and is only used for error messages. |
| 712 | """ |
| 713 | return [x for x in self.parse(string, name) |
| 714 | if isinstance(x, Example)] |
| 715 | |
| 716 | def _parse_example(self, m, name, lineno): |
| 717 | """ |