diff options
author | Guido van Rossum <guido@python.org> | 1996-08-21 16:28:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-08-21 16:28:53 (GMT) |
commit | 16d27e3b141d26853effc6c70214412cebebbe9f (patch) | |
tree | c98f065362f2a1dfd552eff86934cb638dfaf055 /Demo/parser/source.py | |
parent | 6dbd190f5ec3127ad7c5ef6fc67d2f02c4cc1492 (diff) | |
download | cpython-16d27e3b141d26853effc6c70214412cebebbe9f.zip cpython-16d27e3b141d26853effc6c70214412cebebbe9f.tar.gz cpython-16d27e3b141d26853effc6c70214412cebebbe9f.tar.bz2 |
Demos for Fred's parser module
Diffstat (limited to 'Demo/parser/source.py')
-rw-r--r-- | Demo/parser/source.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Demo/parser/source.py b/Demo/parser/source.py new file mode 100644 index 0000000..b1690a5 --- /dev/null +++ b/Demo/parser/source.py @@ -0,0 +1,27 @@ +"""Exmaple file to be parsed for the parsermodule example. + +The classes and functions in this module exist only to exhibit the ability +of the handling information extraction from nested definitions using parse +trees. They shouldn't interest you otherwise! +""" + +class Simple: + "This class does very little." + + def method(self): + "This method does almost nothing." + return 1 + + class Nested: + "This is a nested class." + + def nested_method(self): + "Method of Nested class." + def nested_function(): + "Function in method of Nested class." + pass + return nested_function + +def function(): + "This function lives at the module level." + return 0 |