summaryrefslogtreecommitdiff
path: root/test/scanners/python/import.in.py
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-10-19 17:25:57 +0000
committermurphy <murphy@rubychan.de>2009-10-19 17:25:57 +0000
commit094616e18e4a0f441fe6f88c65dc1b86be5668d2 (patch)
treef785565c18598425c11ef52a39616531041f3db2 /test/scanners/python/import.in.py
parent98cd8c95c53d7865db469f742c541f274057770a (diff)
downloadcoderay-094616e18e4a0f441fe6f88c65dc1b86be5668d2.tar.gz
Updated Python scanner (#41)
* Unicode support (kind of) * [from ...] import ... as construct highlighted as :include * added a test case for import statements
Diffstat (limited to 'test/scanners/python/import.in.py')
-rw-r--r--test/scanners/python/import.in.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/scanners/python/import.in.py b/test/scanners/python/import.in.py
new file mode 100644
index 0000000..95dce3d
--- /dev/null
+++ b/test/scanners/python/import.in.py
@@ -0,0 +1,26 @@
+import YourModule # Import the module into my package
+ # (does not import any of its symbols)
+
+import YourModule as Module # Use a different name for the module
+
+from YourModule import * # Import all module symbols not starting
+ # with an underscore (default); if __all__
+ # is defined, only imports those symbols.
+ # Using this is discouraged unless the
+ # module is specifically designed for it.
+
+from YourModule import name1, name2, xxx
+ # Import the named symbols from the module
+
+from YourModule import name1 as name2
+ # Import the named object, but use a
+ # different name to access it locally.
+
+#-----------------------------
+__all__ = ["F1", "F2", "List"]
+#-----------------------------
+__all__ = ["Op_Func", "Table"]
+#-----------------------------
+from YourModule import Op_Func, Table, F1
+#-----------------------------
+from YourModule import Functions, Table \ No newline at end of file