GitHub - hpyproject/hpy: HPy: a better API for Python (original) (raw)

HPy: a better API for Python

Build Documentation Join the discord server at https://discord.gg/xSzxUbPkTQ

Website: hpyproject.org
Community: HPy Discord server
Mailing list: hpy-dev@python.org

Summary

HPy is a better API for extending Python in C. The old C API is specific to the current implementation of CPython. It exposes a lot of internal details which makes it hard to:

HPy is a specification of a new API and ABI for extending Python that is Python implementation agnostic and designed to hide and abstract internal details such that it:

Please read the documentationfor more details on HPy motivation, goals, and features, for example:

Do you want to see how HPy API looks in code? Check out our quickstart example.

You may also be interested in HPy'sAPI reference.

This repository contains the API and ABI specification and implementation for the CPython interpreter. Other interpreters that support HPy natively: GraalPy and PyPy, provide their own builtin HPy implementations.

Why should I care about this stuff?

See also Python Performance: Past, Present, Futureby Victor Stinner.

What does HPy mean?

The "H" in HPy stands for "handle": one of the key idea of the new API is to use fully opaque handles to represent and pass around Python objects.

Become a financial contributor and help us sustain the HPy community: Contribute to HPy.