python

package module
v10.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 1 Imported by: 0

README

go-python3-submodule

English (poorly_(ˊཀˋ」∠)_) | 简体中文

This project is an incorporated submodule of Go binds to Python3/C APIs.

This project is inspired from DataDog/go-python3 that has Faster compilation with multiple submodules.

Installation

Go Modules
go get github.com/M-Quadra/go-python3-submodule/v10
Python version Package URL
3.10 github.com/M-Quadra/go-python3-submodule/v10
3.9 github.com/M-Quadra/go-python3-submodule/v9
3.8 github.com/M-Quadra/go-python3-submodule/v8

Usage

Call as Python/C API functions. e.g. PyBool_Check(x) call with pybool.Check. The gopls will import the rest automately.

Function names are coming from types. As follow:

Python/C API Go
PyFloat_AsDouble pyfloat.AsFloat64
PyLong_AsLong pylong.AsInt
PyLong_AsLongLong pylong.AsInt64
... ...

If you are confusing while running the code, to check the GIL or reference count.

There are two example for goroutine: example-0 , example-1.

I'd like to use example-0.

Progress

Development environment: macOS (x86-64).

Test environment: Linux (Docker x86-64)

Incorporate the most of the original functions in DataDog/go-python3.

Add the counting check in references that cover the most of test cases.

Todo

  • Unit test of reference counts in Exception.
  • GitHub Action.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PyGILState

type PyGILState C.PyGILState_STATE

PyGILState C.PyGILState_STATE

type PyObject

type PyObject C.PyObject

PyObject C.PyObject

type PyThreadState

type PyThreadState C.PyThreadState

PyThreadState C.PyThreadState

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL