PyD Documentation

PyD Documentation

Release 1.0

Kirk McDonald

Nov 03, 2018

Contents

1

Extending Python with D

1.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

3

2

Embedding Python in D

2.1 InterpContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

6

6

3

PyD and distutils

3.1 Command line flags . . . .

3.2 Extension arguments . . . .

3.3 pydexe . . . . . . . . . . .

3.4 Mixing C and D extensions

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

7

7

8

9

10

Type Conversion

4.1 D to Python . . . . . . . . . . . .

4.2 Python to D . . . . . . . . . . . .

4.3 Numpy . . . . . . . . . . . . . .

4.4 Extending PyDs type conversion

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

11

11

12

12

12

5

Exposing D functions to python

5.1 def template arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15

16

6

Exposing D classes to python

6.1 Member wrapping . . . . . .

6.2 Def template arguments . . .

6.3 StaticDef template arguments

6.4 Property template arguments .

6.5 Member template arguments .

6.6 Operator Overloading . . . .

6.7 Iterator wrapping . . . . . . .

.

.

.

.

.

.

.

19

19

19

20

20

20

21

21

7

PydObject

7.1 Buffer protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

24

8

Using Dub to build

25

9

Exception Wrapping

9.1 handle_exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

27

4

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

i

9.2

exception_catcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

10 Authors

29

11 Overview

31

ii

PyD Documentation, Release 1.0

Contents:

Contents

1

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download