No project description provided
Project description
这个一个对函数进行各方面操作的包,包含了很多十分精妙的功能。
这个包分了几个大的模块,分别对应了不同的函数操作小玩法
装饰器
装饰器部分包含了常见一个装饰器所需的一些辅助类的装饰器函数
wraps
这个装饰器本质就是为了替代functools.wraps而创建的。
它的作用和functools.wraps本质上是一样的,唯一的区别就是它在装饰了函数之后,会把函数的参数和注释全部保留,使得在运行过程中可以正确获得原函数的参数情况。
函数
函数是针对函数直接或间接的一些操作的功能
replace_function
替代函数,其本身是为了解决需要直接改变builtin函数的逻辑(对,就是你,print),但是又希望这个函数的变动可以随时复原,或者能自由地调用原函数地功能。
不过现在这个函数已经被开发得可以任意替换任意包内定义的普通函数
from movoid_function import replace_function
def special_print(text):
return text
replace_function(print, special_print)
a = print("666") #此时不会打印任何信息,并且会给a赋值为'666'
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
movoid_function-1.7.3.tar.gz
(14.4 kB
view details)
Built Distribution
File details
Details for the file movoid_function-1.7.3.tar.gz
.
File metadata
- Download URL: movoid_function-1.7.3.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f0bc32905b6a8997abb057bf193d4275f29fad990ba6fb8d3d3c190579e28ea |
|
MD5 | f8a1bb277f273b6da1b0c488f872a63e |
|
BLAKE2b-256 | 54951c43ce46c4a9c5bf6e36c85da5e9ff53a142943e1742d72a8c5cde170d0c |
File details
Details for the file movoid_function-1.7.3-py3-none-any.whl
.
File metadata
- Download URL: movoid_function-1.7.3-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a830d2e25d28e2fcdbc3eff7a0087238b48adb470179aef36dd7e19411be8d8b |
|
MD5 | 800629941b90c33c4b6bed925a36610a |
|
BLAKE2b-256 | 55711ba829e93334ab9620eccf54b652853e0fb5e4e82fe8544f48dc242cee28 |