Guido van Rossum | 16d27e3 | 1996-08-21 16:28:53 +0000 | [diff] [blame] | 1 | """Exmaple file to be parsed for the parsermodule example. |
| 2 | |
| 3 | The classes and functions in this module exist only to exhibit the ability |
| 4 | of the handling information extraction from nested definitions using parse |
| 5 | trees. They shouldn't interest you otherwise! |
| 6 | """ |
| 7 | |
| 8 | class Simple: |
| 9 | "This class does very little." |
| 10 | |
| 11 | def method(self): |
Guido van Rossum | 4117e54 | 1998-09-14 16:44:15 +0000 | [diff] [blame] | 12 | "This method does almost nothing." |
| 13 | return 1 |
Guido van Rossum | 16d27e3 | 1996-08-21 16:28:53 +0000 | [diff] [blame] | 14 | |
| 15 | class Nested: |
Guido van Rossum | 4117e54 | 1998-09-14 16:44:15 +0000 | [diff] [blame] | 16 | "This is a nested class." |
Guido van Rossum | 16d27e3 | 1996-08-21 16:28:53 +0000 | [diff] [blame] | 17 | |
Guido van Rossum | 4117e54 | 1998-09-14 16:44:15 +0000 | [diff] [blame] | 18 | def nested_method(self): |
| 19 | "Method of Nested class." |
| 20 | def nested_function(): |
| 21 | "Function in method of Nested class." |
| 22 | pass |
| 23 | return nested_function |
Guido van Rossum | 16d27e3 | 1996-08-21 16:28:53 +0000 | [diff] [blame] | 24 | |
| 25 | def function(): |
| 26 | "This function lives at the module level." |
| 27 | return 0 |