Skip to main content

Tools to lock/unlock/fully waste python's built in function/types

Project description

你不该用它 YouShallNotUseIt

允许使用者简单的锁定、解锁或是永久禁用Python中的内置函数/内置类
easily lock & unlock BIF in python.  

它如何工作? How It works

内置类/函数通常存在于__builtins__模块,这是每个脚本运行时虚拟机自动导入的模块。当修改了该模块的内容,运用内置类/函数便会受到影响。
Builtin types or functions exist in module named '__builtins__', which imported automatically by python vm when running a script.
BIF/T may be edited as we change __builtins__'s content.

如何使用 Quick start

>>> from youshallnotuseit import *

>>> print('hello world')
hello world
>>> lock(print)
>>> print('hello world')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Projects\PythonProject\youshallnotuseit\covers\Functions.py", line 7, in LockedFunction
    raise YouShallNotUseIt(lang.func.locked)
youshallnotuseit.covers.Exceptions.YouShallNotUseIt: This Function is Locked

>>> help(print)
Help on function LockedFunction in module youshallnotuseit.covers.Functions:

LockedFunction(*args, **kwargs) -> NoReturn
    This Function is Locked


>>> unlock('print')
>>> print('hello world')
hello world

支持自定义报错信息和文档 allow user to modify error info & doc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youshallnotuseit-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file youshallnotuseit-0.1.0.tar.gz.

File metadata

  • Download URL: youshallnotuseit-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for youshallnotuseit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 956ccc012b55a4a283cd4d8dc8c852c5266c3eec13dda64dd7c2fa94b00bd10c
MD5 38a2f0ca35a0da5b6b4b4b19f6772939
BLAKE2b-256 d142625571113c4a9de3f8690744c7c8da71070a8a08c09086d2e98628923f47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page