From 399d2bcf2116fdf0a453ed1cc1192e994b9d4a90 Mon Sep 17 00:00:00 2001 From: gilch Date: Sun, 25 Sep 2016 21:29:53 -0600 Subject: [PATCH] clarify documentation of import (#1121) * clarify documentation of import Add a comment showing the equivalent python of the long example, and demonstrate how to get `from` and `as` on the same line. * add python example comment in last import example --- docs/language/api.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/language/api.rst b/docs/language/api.rst index 7923cee..fa09c82 100644 --- a/docs/language/api.rst +++ b/docs/language/api.rst @@ -953,11 +953,20 @@ that ``import`` can be used. (import [sys :as systest]) ;; You can list as many imports as you like of different types. + ;; + ;; Python: + ;; from tests.resources import kwtest, function_with_a_dash + ;; from os.path import exists, isdir as is_dir, isfile as is_file + ;; import sys as systest (import [tests.resources [kwtest function-with-a-dash]] - [os.path [exists isdir isfile]] + [os.path [exists + isdir :as dir? + isfile :as file?]] [sys :as systest]) ;; Import all module functions into current namespace + ;; + ;; Python: from sys import * (import [sys [*]])