$npx skillfedfor your agent

forbiddenfruit

Patch python built-in objects

With conditionsPyPI Software DevelopmentReleased Jan 20212.5M downloads / moSource build

Decision gist · record as of 2026-08-14

sdist only — forbiddenfruit-0.1.4.tar.gz · builds from source
v0.1.4 · released 2021-01-16

Yes, if you need to dynamically extend built-in types and are committed to CPython. No, if you use PyPy or other implementations, or prefer to avoid C compilation during install. The dual MIT/GPLv3 license is permissive, but the high install friction and age of the last release mean you should verify compatibility with your specific Python version before relying on it in production.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires CPython (not PyPy, Jython, or other implementations) and a C compiler to build the extension module during installation.
  • High install friction: the package requires compilation against the CPython C API and is only compatible with CPython.
  • Last release was 2021-01-16, but the repository remains active with recent commits.

License · maintenance · safety

(unclear) — Dual-licensed under GPLv3+ and MIT; you may choose either license. This dual licensing provides flexibility—use MIT for permissive integration or GPLv3+ if you prefer copyleft terms.

last release 2021-01-16 (2036 days) · last repo commit 2026-04-03 · 883 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,451,765 downloads/mo, #3,058 on PyPI

Verify before relying

from forbiddenfruit import curse, reverse

def greet(self):
    return f"Hello from {self}"

curse(str, "greet", greet)
print("world".greet())  # Hello from world

reverse(str, "greet")
  • Whether the package works reliably on modern Python versions beyond those explicitly tested (2.7, 3.0, 3.3–3.7).
  • Stability and compatibility with CPython versions released after the last 2021-01-16 release.
  • Whether reverse() correctly restores pre-existing built-in attributes or only removes added ones.
Same gist for agents: .md · .json

What it is and what it does

Forbiddenfruit is a CPython-specific library that uses the Python C API to dynamically patch built-in types (int, str, list, etc.) with new methods and attributes at runtime. It was originally created to support fluent assertion libraries similar to RSpec Expectations, but has been used for spying, profiling integration, and other runtime introspection tasks.

The library provides three main functions: `curse()` to add a method to a built-in type, `reverse()` to remove a cursed attribute, and `cursed()` as a context manager or decorator to temporarily patch a type and automatically clean up on exit. Because it operates at the C API level, it can modify types that are normally immutable from pure Python. However, this power comes with significant constraints: it only works on CPython, requires compilation during installation, and the last release was in early 2021.

Use it for

  • Implement fluent assertion APIs for testing libraries similar to RSpec Expectations.
  • Add introspection or profiling hooks to built-in types without modifying their source.
  • Temporarily extend built-in behavior within a specific code block using the context manager.
  • Spy on or intercept calls to built-in type methods for debugging or monitoring.
  • Prototype or experiment with language-like extensions to Python's core types.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to dynamically extend built-in types and are committed to CPython.

No, if you use PyPy or other implementations, or prefer to avoid C compilation during install. The dual MIT/GPLv3 license is permissive, but the high install friction and age of the last release mean you should verify compatibility with your specific Python version before relying on it in production.

Install

forbiddenfruit on PyPI

Before you install

High install friction: the package requires compilation against the CPython C API and is only compatible with CPython. Last release was 2021-01-16, but the repository remains active with recent commits.

Requires CPython (not PyPy, Jython, or other implementations) and a C compiler to build the extension module during installation.

License in practice

Dual-licensed under GPLv3+ and MIT; you may choose either license. This dual licensing provides flexibility—use MIT for permissive integration or GPLv3+ if you prefer copyleft terms.

Quickstart

from forbiddenfruit import curse, reverse

def greet(self):
    return f"Hello from {self}"

curse(str, "greet", greet)
print("world".greet())  # Hello from world

reverse(str, "greet")

Verify before relying

  • Whether the package works reliably on modern Python versions beyond those explicitly tested (2.7, 3.0, 3.3–3.7).
  • Stability and compatibility with CPython versions released after the last 2021-01-16 release.
  • Whether reverse() correctly restores pre-existing built-in attributes or only removes added ones.

Package facts

LicenseNot declared unclear
Python supportNot specified
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceActively maintained 2,036 days since the last release
Last repo commit
First released
Downloads2,451,765 / month, #3,058 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)License :: OSI Approved :: MIT License

Evidence: forbiddenfruit-0.1.4.tar.gz

Tags

Capabilities
monkey patch built-in typesextend int str list methodsadd methods to built-in classesruntime built-in type modificationcurse reverse built-in objectsdynamic method injection pythonpatch immutable types
Topics
metaprogrammingc-extensiontesting-utilities

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “monkey patch built-in types”

  • forbiddenfruitForbiddenfruit allows you to dynamically add methods and attributes…
  • django-stubs-extProvides runtime monkey-patching extensions for django-stubs to…
  • zipfile-zstdExtends Python's standard zipfile module to read and write ZIP…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also none · patchy · jsonable · wrapt · django-stubs-ext · mixed-methods · cint · pyarrow-hotfix · argparse-ext