Skip to content

Commit 31fe8f3

Browse files
committed
Revert README changes
1 parent 886dc29 commit 31fe8f3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

examples/A21_import_system/import_absolute.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Shows how to enforce and use absolute imports.
22
# ------------------------------------------------------------------------------
33
# Example script demonstrating absolute imports.
4+
from __future__ import absolute_import
45
# Using absolute imports
56
import asyncio
67

7-
# Enforce absolute imports
8-
from __future__ import absolute_import
9-
108
# Absolute imports
119
from foo.api.submodule1 import func1
1210
from foo.core.submodule2 import func2
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Shows how to use relative imports within a package.
2+
# -----------------------------------------------------------------------------
3+
# Demonstrates importing modules from the current package using relative syntax.
4+
5+
from .foo.api.submodule1 import func1
6+
from .foo.core.submodule2 import func2
7+
# Relative imports are scoped to packages.
8+
9+
# Call the imported functions
10+
func1()
11+
func2()

0 commit comments

Comments
 (0)