Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zuzu-typ/python-c-api-extension-template
A template for the Python c-api
https://github.com/zuzu-typ/python-c-api-extension-template
c-api example extension library python python-c-api template
Last synced: 3 months ago
JSON representation
A template for the Python c-api
- Host: GitHub
- URL: https://github.com/zuzu-typ/python-c-api-extension-template
- Owner: Zuzu-Typ
- License: unlicense
- Created: 2018-03-11T20:36:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-01T16:16:49.000Z (almost 6 years ago)
- Last Synced: 2024-10-12T09:51:13.092Z (4 months ago)
- Topics: c-api, example, extension, library, python, python-c-api, template
- Language: C++
- Size: 16.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python C\+\+ extension template
## A template for a Python C\-API based extension
**Why** would you want to have a **Python C\+\+\-extension** in the first place?
The answer is quite simple: **Performance**\.
Although you can achieve improved performance using [Cython](http://cython.org/), you can never beat **C/C\+\+ level performance**\.
## About this template
### Introduction
This template provides a very basic Python extension written in C/C\+\+\.
The extension module "*template*" contains a function "*test*" and a class "*example\_class*"\.
The "*example\_class*" has a single member "*value*" \(of type double => float\), and supports a lot of operations\.
It also shows how to import a module \("math\.pi" in this case\)\.
*Work in progress*\.