BePosPliz (be positional please) is a lightweight module to anonymize the arguments of a function.
Project description
BePosPliz
BePosPliz (be positional please) is a lightweight module to anonymize the arguments of a function.
Features
anon_args
Usage
Let the following function:
from bepospliz import anon_args
@anon_args
def div(a: int, b: int) -> float:
"""Divide a by b"""
return a / b
div
's original signature is div(a: int, b: int) -> float
.
With the decorator @anon_args
, it becomes div(int, int) -> float
, meaning that it cannot be called by specifically naming the args anymore (e.g. div(b=3, a=2)
)
Signature
anon_args(function: Callable[[*Ps], R]) -> Callable[[*Ps], R]
with Ps
being the set of types of function
's arguments, and R
its return type.
Example
Given the previous div
function, Ps
would be (int, int)
and R
would be float
.
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
bepospliz-1.0.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for bepospliz-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eeeb3ffa73326ff05e72592b148430611133cfdfdce9b7ce86bf3ea7fd38001 |
|
MD5 | 00d7d6f348a2e8247b29c43fd7cb6601 |
|
BLAKE2b-256 | 9ab91a7cf4f2211a9bb93a478bc74a1db798431398dda5ecd6a49b4506180744 |