コード例 #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()'
コード例 #2
0
def main():
    print(g(42))
コード例 #3
0
ファイル: main.py プロジェクト: beelives/python-cheat
        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()'
コード例 #4
0
ファイル: b.py プロジェクト: int3l/explains
 def say_hello(self) -> None:
     g()
コード例 #5
0
ファイル: c.py プロジェクト: 32bitfloat/intellij-community
def main():
    print(g(42))