Skip to main content

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


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.8.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

movoid_function-1.8.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file movoid_function-1.8.1.tar.gz.

File metadata

  • Download URL: movoid_function-1.8.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for movoid_function-1.8.1.tar.gz
Algorithm Hash digest
SHA256 d34d38ea7541faf697523628b253fcc3701b3f36e9382af379bcd19e4108bd83
MD5 fe70537c234df3a3c953e92fbc9d54b8
BLAKE2b-256 b3fbe2d119874a572521b851d6634bdd61ee819ca8f987d8e33094c187342736

See more details on using hashes here.

File details

Details for the file movoid_function-1.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for movoid_function-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2d9bed6b6cdf20c3fbd61b5ab45322d4750abeeab60052baee9ade7fb24401d
MD5 3a8ca8e04e6ac17f507c78f85cbf1e3d
BLAKE2b-256 5621c9cf21bf15d15a6e74f4dfc08af2895a06aa4879102632a1c6fd0f8b7c51

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