
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Masks fp is a powerful wrapping tool that preserves meta and anatomical information. 🎭
Advanced ⬦ Powerful ⬦ Tooling
Wrapping is a technique targeting function extensibility, taking metadata of one function and merging it with another, including any intended additional functionality, forming a new function.
Mask fp is a powerful tool made for wrapping functions and is built on top of the functools.wraps
function. The masks
function allows for quick creation of wrapper function look-alikes by placing the masks
decorator over target wrapper functions and calling it along with the desired target wrapped function. Furthermore, the masks
function will preserve type hinting, signatures, annotations, and the application of default arg and kwarg values, for an enhanced developer experience and potentially advanced use cases.
__signature__
and __annotations__
for wrappers; parameters of wrapped
and return annotation of wrapper
.Using pip
pip install masks-fp
Or using Poetry
poetry add masks-fp
from collections.abc import Callable, Iterable
from mask_fp import masks
def decorator(f: Callable[..., Iterable[int]]) -> Callable:
@masks(f)
def wrapper(*args, **kwargs) -> dict[str, int | Iterable[int]]:
"""
From ``wrapper`` ``docstring``. 👋
"""
print(f"Sum of {f(*args, **kwargs)} is {sum(f(*args, **kwargs))}. 🎓")
return f(*args, **kwargs)
return wrapper
@decorator
def wrapped(a: int, /, b: int = 2, *, c: int = 3) -> tuple[int, int, int]:
"""
From ``wrapped`` ``docstring``. 👋
"""
return (a, b, c)
Without using default values
>>> print(wrapped(1, 2, c=3))
Sum of (1, 2, 3) is 6. 🎓
(1, 2, 3)
Using default values
>>> print(wrapped(1))
Sum of (1, 2, 3) is 6. 🎓
(1, 2, 3)
FAQs
Masks fp is a powerful wrapping tool that preserves meta and anatomical information. 🎭
We found that masks-fp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.