Documentation
¶
Index ¶
- func AllocCStr(s string) *C.char
- func AllocCStrDontFree(s string) *C.char
- func Cast[U, T Objecter](obj T) (u U)
- func FetchError() error
- func Finalize()
- func GoString(s *C.char) string
- func GoStringN(s *C.char, n int) string
- func Initialize()
- func RunString(code string) error
- func SetError(err error)
- func SetTypeError(err error)
- func ToValue(obj Object, v reflect.Value) bool
- func With[T Objecter](obj T, fn func(v T)) T
- type Bool
- type Bytes
- type Char
- type Complex
- type Dict
- func (d Dict) Del(key Objecter)
- func (obj Dict) Ensure()
- func (d Dict) Get(key Objecter) Object
- func (d Dict) GetString(key string) Object
- func (d Dict) HasKey(key any) bool
- func (d Dict) Items() func(fn func(key, value Object) bool)
- func (obj Dict) Nil() bool
- func (d Dict) Set(key, value Objecter)
- func (d Dict) SetString(key string, value Objecter)
- type Float
- type Func
- type InputType
- type Int
- type KwArgs
- type List
- type Long
- type Module
- type Object
- func (obj Object) AsBool() Bool
- func (obj Object) AsBytes() Bytes
- func (obj Object) AsComplex() Complex
- func (obj Object) AsDict() Dict
- func (obj Object) AsFloat() Float
- func (obj Object) AsFunc() Func
- func (obj Object) AsList() List
- func (obj Object) AsLong() Long
- func (obj Object) AsModule() Module
- func (obj Object) AsStr() Str
- func (obj Object) AsTuple() Tuple
- func (obj Object) Attr(name string) Object
- func (obj Object) AttrBool(name string) Bool
- func (obj Object) AttrBytes(name string) Bytes
- func (obj Object) AttrDict(name string) Dict
- func (obj Object) AttrFloat(name string) Float
- func (obj Object) AttrFunc(name string) Func
- func (obj Object) AttrList(name string) List
- func (obj Object) AttrLong(name string) Long
- func (obj Object) AttrString(name string) Str
- func (obj Object) AttrTuple(name string) Tuple
- func (obj Object) Call(name string, args ...any) Object
- func (obj Object) Dir() List
- func (obj Object) Ensure()
- func (obj Object) Equals(other Objecter) bool
- func (obj Object) IsBool() bool
- func (obj Object) IsBytes() bool
- func (obj Object) IsComplex() bool
- func (obj Object) IsDict() bool
- func (obj Object) IsFloat() bool
- func (obj Object) IsList() bool
- func (obj Object) IsLong() bool
- func (obj Object) IsStr() bool
- func (obj Object) IsTuple() bool
- func (obj Object) Nil() bool
- func (obj Object) Obj() *PyObject
- func (obj Object) Repr() string
- func (obj Object) SetAttr(name string, value any)
- func (obj Object) String() string
- func (obj Object) Type() Object
- type Objecter
- type Pointer
- type PyCFunction
- type PyObject
- type Str
- type Tuple
- type WChar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocCStrDontFree ¶
func Initialize ¶
func Initialize()
func SetTypeError ¶
func SetTypeError(err error)
Types ¶
type Complex ¶
type Complex struct {
Object
}
func MakeComplex ¶
func MakeComplex(f complex128) Complex
func (Complex) Complex128 ¶
func (c Complex) Complex128() complex128
type Dict ¶
type Dict struct {
Object
}
func DictFromPairs ¶
func GetModuleDict ¶
func GetModuleDict() Dict
type Float ¶
type Float struct {
Object
}
Float represents a Python float object. It provides methods to convert between Go float types and Python float objects, as well as checking numeric properties.
type InputType ¶
const ( SingleInput InputType = C.Py_single_input FileInput InputType = C.Py_file_input EvalInput InputType = C.Py_eval_input )
type Long ¶
type Long struct {
Object
}
func LongFromFloat64 ¶
func LongFromString ¶
func LongFromUintptr ¶
func LongFromUnicode ¶
type Module ¶
type Module struct {
Object
}
func CreateModule ¶
func ImportModule ¶
func MainModule ¶
func MainModule() Module
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func (Object) AttrString ¶
type Objecter ¶
type Objecter interface {
Obj() *PyObject
Ensure()
// contains filtered or unexported methods
}
type PyCFunction ¶
type PyCFunction = C.PyCFunction
Source Files
¶
Click to show internal directories.
Click to hide internal directories.