{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/17"}],"enrichment":{"capability":"A drop-in replacement for `functools.wraps` that preserves static type information when wrapping functions, so type checkers see the wrapped function's actual signature instead of `*args, **kwargs`.","skillfed_tags":["typing","decorators"],"use_cases":["Wrapping functions in decorators while maintaining type safety for static analysis.","Building decorator libraries where callers should see the original function's signature in their IDE and type checker.","Ensuring runtime function metadata (name, docstring, annotations) stays accurate while preserving type hints.","Wrapping methods in classes with correct typing for both static checkers and runtime introspection."],"what_it_does":"tightwrap is a minimal library that solves a specific typing problem: when you use `functools.wraps` to decorate a function, static type checkers like mypy lose the original function's signature and see only `*args, **kwargs`. This breaks type safety\u2014a caller can pass the wrong types and the checker won't catch it. tightwrap.wraps has the same runtime behavior as `functools.wraps` but preserves the wrapped function's type signature for static analysis, so type checkers correctly report signature mismatches.\n\nThe package is intentionally small and has only one runtime dependency (`typing-extensions`). It applies `functools.wraps` under the hood to maintain runtime introspection compatibility, and it handles cases where the wrapper has a different return type than the wrapped function. Recent versions add support for wrapping methods and modern Python versions (3.13, 3.14).","worth_installing":"Yes. If you write decorators or function wrappers and use a static type checker, this is a straightforward win: it fixes a real gap in `functools.wraps` with zero complexity, no security issues, active maintenance, and a permissive license. If you don't use type checking or don't write wrappers, you don't need it."},"id":"tightwrap","links":{"html":"https://skillfed.io/packages/tightwrap","md":"https://skillfed.io/packages/tightwrap.md","pypi":"https://pypi.org/project/tightwrap/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-04","license_spdx":null,"license_treatment":"permissive","name":"tightwrap","python_support":"supports_current","summary":"A typed `functools.wraps`."},"popularity":{"monthly_downloads":90943,"position":13554,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"26.1.0"}
