File tree 4 files changed +389
-300
lines changed
4 files changed +389
-300
lines changed Original file line number Diff line number Diff line change 1
- # Python C extension template
1
+ # Python C\+\+ extension template
2
2
## A template for a Python C\- API based extension
3
- ** Why** would you want to have a ** Python C\- extension** in the first place?
3
+ ** Why** would you want to have a ** Python C\+\+\ - extension** in the first place?
4
4
The answer is quite simple: ** Performance** \.
5
- Although you can achieve improved performance using [ Cython] ( http://cython.org/ ) , you can never beat ** C level performance** \.
5
+ Although you can achieve improved performance using [ Cython] ( http://cython.org/ ) , you can never beat ** C/C \+\+ level performance** \.
6
6
7
7
## About this template
8
8
### Introduction
9
- This template provides a very basic Python extension written in C\.
10
- The extension module "* template* " contains a function "* test* " and a class "* example_class * "\.
11
- The "* example_class * " has a single member "* value* " \( of type double => float\) , and supports a lot of operations\.
9
+ This template provides a very basic Python extension written in C/C \+\+ \.
10
+ The extension module "* template* " contains a function "* test* " and a class "* example \_ class * "\.
11
+ The "* example \_ class * " has a single member "* value* " \( of type double => float\) , and supports a lot of operations\.
12
12
It also shows how to import a module \( "math\. pi" in this case\)\.
13
13
14
14
* Work in progress* \.
Original file line number Diff line number Diff line change 1
- [title]Python C extension template[/]
1
+ [title]Python C++ extension template[/]
2
2
[subtitle]A template for a Python C-API based extension[/]
3
- [b]Why[/] would you want to have a [b]Python C-extension[/] in the first place?
3
+ [b]Why[/] would you want to have a [b]Python C++ -extension[/] in the first place?
4
4
The answer is quite simple: [b]Performance[/].
5
- Although you can achieve improved performance using [url=http://cython.org/]Cython[/], you can never beat [b]C level performance[/].
5
+ Although you can achieve improved performance using [url=http://cython.org/]Cython[/], you can never beat [b]C/C++ level performance[/].
6
6
7
7
[s1]About this template[/]
8
8
[s2]Introduction[/]
9
- This template provides a very basic Python extension written in C.
9
+ This template provides a very basic Python extension written in C/C++ .
10
10
The extension module "[i]template[/]" contains a function "[i]test[/]" and a class "[i]example_class[/]".
11
11
The "[i]example_class[/]" has a single member "[i]value[/]" (of type double => float), and supports a lot of operations.
12
12
It also shows how to import a module ("math.pi" in this case).
Original file line number Diff line number Diff line change 1
1
2
- ###########################
3
- Python C extension template
4
- ###########################
2
+ ###############################
3
+ Python C\+\+ extension template
4
+ ###############################
5
5
6
6
**********************************************
7
7
A template for a Python C\- API based extension
8
8
**********************************************
9
- | **Why** would you want to have a **Python C\-extension** in the first place\?
9
+ | **Why** would you want to have a **Python C\+\+\ -extension** in the first place\?
10
10
| The answer is quite simple\: **Performance**\.
11
- | Although you can achieve improved performance using `Cython <http://cython.org/>`_\, you can never beat **C level performance**\.
11
+ | Although you can achieve improved performance using `Cython <http://cython.org/>`_\, you can never beat **C\/C\+\+ level performance**\.
12
12
|
13
13
14
14
About this template
15
15
===================
16
16
17
17
Introduction
18
18
------------
19
- | This template provides a very basic Python extension written in C\.
19
+ | This template provides a very basic Python extension written in C\/C\+\+\ .
20
20
| The extension module \"*template*\" contains a function \"*test*\" and a class \"*example\_class*\"\.
21
21
| The \"*example\_class*\" has a single member \"*value*\" \(of type double \=\> float\)\, and supports a lot of operations\.
22
22
| It also shows how to import a module \(\"math\.pi\" in this case\)\.
You can’t perform that action at this time.
0 commit comments