Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

entrancebar

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

entrancebar

importext

  • 0.0.27
  • PyPI
  • Socket score

Maintainers
1

这是什么?

这是一个导入一次解耦方案, 封装了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()内.

所以这么没用的玩意发出来干啥?

给我自己用.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc