-
Notifications
You must be signed in to change notification settings - Fork 9
/
doc.go
36 lines (28 loc) · 1.52 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2011 Julian Phillips. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package py (github.com/limetext/gopy) provides access to the CPython C API. This
package presents an idomatic Go interface to the CPython C API described at
http://docs.python.org/c-api/index.html
Instead of simply exposing the C API as-is, this package uses interfaces,
embedding, type assertions and methods to try and present the functionality of
the Python API in a manner that feels more natural in Go.
Embedding Python
Embedding Python is fully supported, with the ability to initialise the
interpreter, enable threading support, manipulate the GIL and call Python API
functions to manipulate Python objects.
In addition to providing the ability to use the API to call into Python calling
from Python back into Go is also supported. New types can be implemented in Go
and exposed into Python.
In addition to the normal Python C API, a optional (i.e. it must be explictly
enabled) "go" package can be presented to the embedded Python. This gives
access to some Go functionality - currently the only extra available is the Chan
class, which allows Go and Python code to communicate by exchanging Python
objects over a Go channel.
Python Extensions
Currently it is not possible to write Python extensions in Go, as there is no
support for producing Go shared libraries in the gc compiler suite, and no
support for using shared libraries in the gccgo Go runtime.
*/
package py