Python: Add PEP-328 test example

Based on https://www.python.org/dev/peps/pep-0328/#guido-s-decision

Original "code" is in the Public Domain.
This commit is contained in:
Taus Brock-Nannestad
2020-10-16 12:03:43 +02:00
parent b895641a83
commit 60fcb5e7d5
9 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1 @@
pass

View File

@@ -0,0 +1 @@
bar = "bar"

View File

@@ -0,0 +1 @@
foo = "foo"

View File

@@ -0,0 +1,16 @@
from .moduleY import spam
from .moduleY import spam as ham
from . import moduleY
from ..subpackage1 import moduleY
from ..subpackage2.moduleZ import eggs
from ..moduleA import foo
try:
from ...package import bar
except Exception as e:
print(e)
try:
from ...sys import path
except Exception as e:
print(e)

View File

@@ -0,0 +1,16 @@
from .moduleY import spam
from .moduleY import spam as ham
from . import moduleY
from ..subpackage1 import moduleY
from ..subpackage2.moduleZ import eggs
from ..moduleA import foo
try:
from ...package import bar
except Exception as e:
print(e)
try:
from ...sys import path
except Exception as e:
print(e)

View File

@@ -0,0 +1 @@
spam = "spam"

View File

@@ -0,0 +1 @@
eggs = "eggs"

View File

@@ -0,0 +1 @@
import package.subpackage1.moduleX