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
This commit is contained in:
parent
1d3142c8de
commit
399d2bcf21
@ -953,11 +953,20 @@ that ``import`` can be used.
|
|||||||
(import [sys :as systest])
|
(import [sys :as systest])
|
||||||
|
|
||||||
;; You can list as many imports as you like of different types.
|
;; 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]]
|
(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])
|
[sys :as systest])
|
||||||
|
|
||||||
;; Import all module functions into current namespace
|
;; Import all module functions into current namespace
|
||||||
|
;;
|
||||||
|
;; Python: from sys import *
|
||||||
(import [sys [*]])
|
(import [sys [*]])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user