Registry / serialization / forge
library0.22.0pypypi✓ verified 86d ago

Forge provides a collection of utilities for function signatures, including creating new signatures, binding arguments, and adapting functions. Current version 18.6.0 is stable and actively maintained. Release cadence is irregular.

pip install python-forge
INSTALL
IMPORT
SIG · FORGE
F
forge
serializationpythonv0.22.0
Install
1.5s avg
Import
202ms
Disk
101MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.216s · 65.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.5s · import 0.188s · 137MB
101MB installed
● package 101MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

forge
import forge
from forge import Fn
Top-level module is simply 'forge'. Submodules like forge.fn or forge.signature exist.

Demonstrates creating a signature and binding to a function.

import forge def foo(a, b, c): return a + b + c # Create a new signature sig = forge.signature( forge.arg('a', int), forge.arg('b', int), forge.arg('c', int, default=0) ) # Bind a function with new signature bound = forge.bind(foo, sig) print(bound(1, 2)) # 3
Debug
Known issues
gotchaBinding a function with forge.signature changes the function's __name__ and __code__, which can break tools that rely on function identity (e.g., pickling, decorators).
fix
Use forge.fn or forge.signature with caution; avoid binding on functions that need to be pickled.
affects: all
gotchaForge does not enforce type hints at runtime; the signature's types are metadata only.
fix
Add explicit runtime type checking separately if needed.
affects: all
Errors
Common errors & fixes
AttributeError: module 'forge' has no attribute 'Fn'
The expected top-level symbol 'Fn' does not exist; correct usage is 'import forge' and then use forge.fn.
fix
Use `import forge` and access forge.fn for function manipulation.
ImportError: cannot import name 'signature' from 'forge'
Incorrect import path; forge.signature is a function, not a submodule.
fix
Use `import forge` and call `forge.signature(...)`.
Upgrade
Version history
0.22.0latest on PyPI · released Jan 11, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
forge — pip install forge · libregistry