Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hroncok/importexec

Just an example to illustrate some behavior of imports
https://github.com/hroncok/importexec

Last synced: 15 days ago
JSON representation

Just an example to illustrate some behavior of imports

Awesome Lists containing this project

README

        

Examine the files. Run the following to see the difference:

```console
$ python3 -c 'import foo.bar'
running foo/__init__.py
running foo/bar.py
will import foo
foo.__file__ is .../importexec/foo/__init__.py
foo.thing is 0
foo.foo does not exist
```

```console
$ python3 -c 'import foo.foo; import foo.bar'
running foo/__init__.py
running foo/foo.py
running foo/bar.py
will import foo
foo.__file__ is .../importexec/foo/__init__.py
foo.thing is 0
foo.foo exists
foo.foo.thing is 1
```

```console
$ python3 foo/bar.py
running foo/bar.py
will import foo
running foo/foo.py
foo.__file__ is .../importexec/foo/foo.py
foo.thing is 1
foo.foo does not exist
```

Files in this repo are Public Domain.