master v3.9.0
Stein Ivar Berghei 2023-05-24 17:30:48 +09:00
parent 8c7eedeae7
commit 7d65f97b9f
11 changed files with 129 additions and 98 deletions

View File

@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
package python3
/*
#cgo pkg-config: python-3.9-embed
#include "Python.h"
#include "macro.h"
*/

View File

@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
package python3
/*
#cgo pkg-config: python-3.9-embed
#include "Python.h"
#include "macro.h"
*/

View File

@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
package python3
/*
#cgo pkg-config: python-3.9-embed
#include "Python.h"
#include "macro.h"
*/

View File

@ -137,6 +137,6 @@ func PyDict_Next(p *PyObject, ppos *int, pkey, pvalue **PyObject) bool {
}
//PyDict_ClearFreeList : https://docs.python.org/3/c-api/dict.html#c.PyDict_ClearFreeList
func PyDict_ClearFreeList() int {
return int(C.PyDict_ClearFreeList())
}
//func PyDict_ClearFreeList() int {
// return int(C.PyDict_ClearFreeList())
//}

View File

@ -58,6 +58,6 @@ func PyFloat_GetMin() float64 {
}
//PyFloat_ClearFreeList : https://docs.python.org/3/c-api/float.html#c.PyFloat_ClearFreeList
func PyFloat_ClearFreeList() int {
return int(C.PyFloat_ClearFreeList())
}
//func PyFloat_ClearFreeList() int {
// return int(C.PyFloat_ClearFreeList())
//}

13
go.mod Normal file
View File

@ -0,0 +1,13 @@
module git.stein-ivar.net/steino/cpy3
go 1.20
require (
github.com/go-python/cpy3 v0.2.0
github.com/stretchr/testify v1.2.2
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
)

8
go.sum Normal file
View File

@ -0,0 +1,8 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-python/cpy3 v0.2.0 h1:IQ8v6KOTGSvejROZ8BPCfVW4rSMOKfpVwDi6sKYuu1w=
github.com/go-python/cpy3 v0.2.0/go.mod h1:W7F8SGWQv11501PYSj9d+NSv8U0/vWYa+FcMxBu4eqo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=

View File

@ -83,6 +83,8 @@ func PyList_AsTuple(list *PyObject) *PyObject {
}
//PyList_ClearFreeList : https://docs.python.org/3/c-api/list.html#c.PyList_ClearFreeList
/*
func PyList_ClearFreeList() int {
return int(C.PyList_ClearFreeList())
}
*/

1
sys.go
View File

@ -8,6 +8,7 @@ Copyright 2018 Datadog, Inc.
package python3
/*
#cgo pkg-config: python-3.9-embed
#include "Python.h"
*/
import "C"

View File

@ -19,9 +19,11 @@ type PyThreadState C.PyThreadState
type PyGILState C.PyGILState_STATE
//PyEval_InitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
/*
func PyEval_InitThreads() {
C.PyEval_InitThreads()
}
*/
// PyEval_ThreadsInitialized : https://docs.python.org/3/c-api/init.html#c.PyEval_ThreadsInitialized
func PyEval_ThreadsInitialized() bool {
@ -49,9 +51,11 @@ func PyThreadState_Swap(tstate *PyThreadState) *PyThreadState {
}
// PyEval_ReInitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_ReInitThreads
/*
func PyEval_ReInitThreads() {
C.PyEval_ReInitThreads()
}
*/
// PyGILState_Ensure : https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure
func PyGILState_Ensure() PyGILState {