MCPcopy Create free account
hub / github.com/go-python/gopy / stdBasicTypes

Function stdBasicTypes

bind/stdtypes.go:34–413  ·  view source on GitHub ↗

stdBasicTypes returns the basic int, float etc types as symbols

()

Source from the content-addressed store, hash-verified

32
33// stdBasicTypes returns the basic int, float etc types as symbols
34func stdBasicTypes() map[string]*symbol {
35 look := types.Universe.Lookup
36 syms := map[string]*symbol{
37 "bool": {
38 gopkg: look("bool").Pkg(),
39 goobj: look("bool"),
40 gotyp: look("bool").Type(),
41 kind: skType | skBasic,
42 goname: "bool",
43 id: "bool",
44 cgoname: "C.char",
45 cpyname: "bool",
46 pysig: "bool",
47 go2py: "boolGoToPy",
48 py2go: "boolPyToGo",
49 zval: "false",
50 pyfmt: "", // TODO:
51 },
52
53 "byte": {
54 gopkg: look("byte").Pkg(),
55 goobj: look("byte"),
56 gotyp: look("byte").Type(),
57 kind: skType | skBasic,
58 goname: "byte",
59 id: "int",
60 cpyname: "uint8_t",
61 cgoname: "C.char",
62 pysig: "int", // FIXME(sbinet) py2/py3
63 go2py: "C.char",
64 py2go: "byte",
65 zval: "0",
66 pyfmt: "b",
67 },
68
69 "int": {
70 gopkg: look("int").Pkg(),
71 goobj: look("int"),
72 gotyp: look("int").Type(),
73 kind: skType | skBasic,
74 goname: "int",
75 id: "int",
76 cpyname: "int",
77 cgoname: "C.long", // see below for 64 bit version
78 pysig: "int",
79 go2py: "C.long",
80 py2go: "int",
81 zval: "0",
82 pyfmt: "i",
83 },
84
85 "int8": {
86 gopkg: look("int8").Pkg(),
87 goobj: look("int8"),
88 gotyp: look("int8").Type(),
89 kind: skType | skBasic,
90 goname: "int8",
91 id: "int",

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected