From cae27c1fb3d6058749110dac65b166d9aeba33a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 16 Oct 2021 17:18:42 +0200 Subject: [PATCH] Imports --- README.md | 5 +++-- index.html | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 82b99f9..da01ea7 100644 --- a/README.md +++ b/README.md @@ -817,8 +817,9 @@ import # Imports a built-in or '.py'. import # Imports a built-in or '/__init__.py'. import . # Imports a built-in or '/.py'. ``` -* **Package is a collection of multiple modules, but it can also define its own objects. Python treats any directory containing a file called `'__init__.py'` as a package.** -* **Running `'import '` does not automatically provide access to package's modules unless they are imported in its init script.** +* **Package is a collection of modules, but it can also define its own objects.** +* **On a filesystem this corresponds to a directory of Python files with an optional init script.** +* **Running `'import '` does not automatically provide access to the package's modules unless they are explicitly imported in its init script.** Closure diff --git a/index.html b/index.html index 1372d41..2e416ed 100644 --- a/index.html +++ b/index.html @@ -226,7 +226,7 @@ pre.prettyprint {
- +
@@ -847,8 +847,9 @@ creature = Creature(point, direction)
    -
  • Package is a collection of multiple modules, but it can also define its own objects. Python treats any directory containing a file called '__init__.py' as a package.
  • -
  • Running 'import <package>' does not automatically provide access to package's modules unless they are imported in its init script.
  • +
  • Package is a collection of modules, but it can also define its own objects.
  • +
  • On a filesystem this corresponds to a directory of Python files with an optional init script.
  • +
  • Running 'import <package>' does not automatically provide access to the package's modules unless they are explicitly imported in its init script.

#Closure

We have a closure in Python when:

  • A nested function references a value of its enclosing function and then
  • @@ -3016,7 +3017,7 @@ $ pyinstaller script.py --add-data '<path>:.'