github.com/goplus/llgo@v0.8.3/py/code.go (about) 1 /* 2 * Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package py 18 19 import ( 20 _ "unsafe" 21 ) 22 23 // https://docs.python.org/3/c-api/code.html 24 25 // Equivalent to the Python code getattr(co, 'co_code'). Returns a strong 26 // reference to a BytesObject representing the bytecode in a code object. 27 // On error, nil is returned and an exception is raised. 28 // 29 // This BytesObject may be created on-demand by the interpreter and does 30 // not necessarily represent the bytecode actually executed by CPython. 31 // The primary use case for this function is debuggers and profilers. 32 // 33 // llgo:link (*Object).CodeBytes C.PyCode_GetCode 34 func (o *Object) CodeBytes() *Object { return nil } 35 36 // Equivalent to the Python code getattr(co, 'co_varnames'). Returns a new 37 // reference to a TupleObject containing the names of the local variables. 38 // On error, nil is returned and an exception is raised. 39 // 40 // llgo:link (*Object).CodeVarnames C.PyCode_GetVarnames 41 func (o *Object) CodeVarnames() *Object { return nil }