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