Files
llgo/py/object.go

52 lines
1.8 KiB
Go
Raw Normal View History

2024-05-11 04:26:41 +08:00
/*
* Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package py
import (
_ "unsafe"
"github.com/goplus/llgo/c"
)
// Object represents a Python object.
type Object struct {
Unused [8]byte
}
// llgo:link (*Object).DecRef C.Py_DecRef
2024-05-11 23:38:21 +08:00
func (o *Object) DecRef() {}
2024-05-11 04:26:41 +08:00
2024-05-13 19:48:33 +08:00
// Compute a string representation of object o. Returns the string representation on
// success, nil on failure. This is the equivalent of the Python expression str(o).
// Called by the str() built-in function and, therefore, by the print() function.
//
// llgo:link (*Object).Str C.PyObject_Str
func (o *Object) Str() *Object { return nil }
2024-05-11 04:26:41 +08:00
// -----------------------------------------------------------------------------
2024-05-11 06:23:05 +08:00
// Retrieve an attribute named attrName from object o. Returns the attribute value on success,
// or nil on failure. This is the equivalent of the Python expression o.attrName.
//
// llgo:link (*Object).GetAttr C.PyObject_GetAttr
2024-05-11 23:38:21 +08:00
func (o *Object) GetAttr(attrName *Object) *Object { return nil }
2024-05-11 06:23:05 +08:00
// llgo:link (*Object).GetAttrString C.PyObject_GetAttrString
2024-05-11 23:38:21 +08:00
func (o *Object) GetAttrString(attrName *c.Char) *Object { return nil }
2024-05-11 06:23:05 +08:00
// -----------------------------------------------------------------------------