Impexpr
A simple superset of Python with import expressions added in. Beware: This project has only been made as a proof of concept and is not intended to ever be used in production.
Installation
pip install impexpr
Quickstart
impexpr alias can be used in the same way as python alias, a few examples:
- To run an interactive REPL with import expression support, run
impexpr - To run a script, run
impexpr script.py(all imported modules will also support import expressions) - To import itertools and use it in the same line:
for x in (import itertools).chain([1, 2], [3, 4], [5, 6]):
print(x)
- To get help about collections.deque:
help((import collections).deque)
- If your script must run with python alias but you want to enable import expression support in all imported modules (not in the main script!), you can use:
import impexpr
impexpr.add_hook()
# this will now support import expressions
import my_other_script
- For everything else, run
impexpr --help
FAQ
- Relative imports not supported yet
Release files for impexpr 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| impexpr-0.0.5.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| impexpr-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / impexpr-0.0.5.tar.gz
| Download URL | impexpr-0.0.5.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3d615be56659c803111b6323ab84f18c970c6481083debab1f14cc1659f92da
|
|
BLAKE2b-256 checksum How to use checksums |
2338d457a69449c6c920e0536ae240235117ed265f75babd70e8605ac375d0cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.4 Linux/5.15.38-1-MANJARO
|
Release files / impexpr-0.0.5-py3-none-any.whl
| Download URL | impexpr-0.0.5-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7955026450c662dadc57df5ebc6c9d5c60af92b9bc0830d5ecbb1fe1ef57479a
|
|
BLAKE2b-256 checksum How to use checksums |
c4174ee0f412f59becde86b939c55c44a10e7c88e1a73d97b5024ba49b07108c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.4 Linux/5.15.38-1-MANJARO
|