importext
Project description
这是什么?
这是一个导入一次解耦方案, 封装了importlib并进行了底层的修改.
这能干什么?
from entrancebar.Import import Import
from entrancebar.sources import FromSitePackage, FromFileLocation
os, Path, getframe, join, thisfile = Import(
os="os::$this",
Path="pathlib::Path",
getframe="sys::_getframe",
join="os::path/join",
thisfile="testfile::$this"
)(
os=FromSitePackage("os"),
pathlib=FromSitePackage("pathlib"),
sys=FromSitePackage("sys"),
testfile=FromFileLocation("./test.py")
) # 实际上, 导入不需要解构运算符, Import会直接把传入的具名实参导入到当前的globals()内.
所以这么没用的玩意发出来干啥?
给我自己用.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
entrancebar-0.0.27.tar.gz
(5.7 kB
view details)
File details
Details for the file entrancebar-0.0.27.tar.gz
.
File metadata
- Download URL: entrancebar-0.0.27.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b1edd613ea26237028cf36239e61f4d26f1d1b95472ea9851019b6d8280ff70 |
|
MD5 | 021a670ab6b62d852b348da0777ec992 |
|
BLAKE2b-256 | 03591389a3fd1ddfcfb4d0f23336e52b3779cd2f9df6186091cd83b546bffb9b |