Example #1
0
        if '##star ##*':

            # Never use this except for bad practice.

            # Makes it very hard to know what is being imported or not and what is its name!

            from d import *
            assert a2.f() == "d.a2.f()"
            assert d2.f() == "d.d2.f()"

            # Can also be used to import module contents:

            from a import *
            assert f() == 'a.f()'
            assert g() == 'a.g()'

            # If module is a dir, imports both its:

            from d import *
            assert f() == 'd.f()'
            assert a2.f() == 'd.a2.f()'
            assert d2.f() == 'd.d2.f()'

            # Will import nothing, since a has no submodules.

        if '##as':

            from a import f as g
            assert g() == 'a.f()'
Example #2
0
def main():
    print(g(42))
Example #3
0
        if '##star ##*':

            # Never use this except for bad practice.

            # Makes it very hard to know what is being imported or not and what is its name!

            from d import *
            assert a2.f() == "d.a2.f()"
            assert d2.f() == "d.d2.f()"

            # Can also be used to import module contents:

            from a import *
            assert f() == 'a.f()'
            assert g() == 'a.g()'

            # If module is a dir, imports both its:

            from d import *
            assert f() == 'd.f()'
            assert a2.f() == 'd.a2.f()'
            assert d2.f() == 'd.d2.f()'

            # Will import nothing, since a has no submodules.

        if '##as':

            from a import f as g
            assert g() == 'a.f()'
Example #4
0
File: b.py Project: int3l/explains
 def say_hello(self) -> None:
     g()
Example #5
0
def main():
    print(g(42))