Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

src/p/y/Py2C-HEAD/tests/test_translator.py   Py2C(Download)
    def test_import_module(self):
        self.template([
            (  # Single import
                "import apple",
                python.Import((
            (  # Single subpackage import
                "import apple.ball",
                python.Import((
                    python.alias("apple.ball", None),
                ))
            ),
            (  # Single alias import
                "import apple as ball",
                python.Import((
            (  # Multiple imports, 1 alias, 1 simple
                "import apple as ball, cat",
                python.Import((
                    python.alias("apple", "ball"),
                    python.alias("cat", None),
                ))
            ),
            (  # Multiple alias imports
                "import apple as ball, cat as dog",
                python.Import((