github.com/goplus/llgo@v0.8.3/py/sys/gen.go (about) 1 package sys 2 3 import ( 4 _ "unsafe" 5 6 "github.com/goplus/llgo/py" 7 ) 8 9 const LLGoPackage = "py.sys" 10 11 // Adds a new audit hook callback. 12 // 13 //go:linkname Addaudithook py.addaudithook 14 func Addaudithook(hook *py.Object) *py.Object 15 16 // Print an object to sys.stdout and also save it in builtins._ 17 // 18 //go:linkname Displayhook py.displayhook 19 func Displayhook(object *py.Object) *py.Object 20 21 // Return the current exception. 22 // 23 // Return the most recent exception caught by an except clause 24 // in the current stack frame or in an older stack frame, or None 25 // if no such exception exists. 26 // 27 //go:linkname Exception py.exception 28 func Exception() *py.Object 29 30 // Return current exception information: (type, value, traceback). 31 // 32 // Return information about the most recent exception caught by an except 33 // clause in the current stack frame or in an older stack frame. 34 // 35 //go:linkname ExcInfo py.exc_info 36 func ExcInfo() *py.Object 37 38 // Handle an exception by displaying it with a traceback on sys.stderr. 39 // 40 //go:linkname Excepthook py.excepthook 41 func Excepthook(exctype *py.Object, value *py.Object, traceback *py.Object) *py.Object 42 43 // Exit the interpreter by raising SystemExit(status). 44 // 45 // If the status is omitted or None, it defaults to zero (i.e., success). 46 // If the status is an integer, it will be used as the system exit status. 47 // If it is another kind of object, it will be printed and the system 48 // exit status will be one (i.e., failure). 49 // 50 //go:linkname Exit py.exit 51 func Exit(status *py.Object) *py.Object 52 53 // Return the current default encoding used by the Unicode implementation. 54 // 55 //go:linkname Getdefaultencoding py.getdefaultencoding 56 func Getdefaultencoding() *py.Object 57 58 // Return the current value of the flags that are used for dlopen calls. 59 // 60 // The flag constants are defined in the os module. 61 // 62 //go:linkname Getdlopenflags py.getdlopenflags 63 func Getdlopenflags() *py.Object 64 65 // Return the number of memory blocks currently allocated. 66 // 67 //go:linkname Getallocatedblocks py.getallocatedblocks 68 func Getallocatedblocks() *py.Object 69 70 // Return the number of elements of the unicode interned dictionary 71 // 72 //go:linkname Getunicodeinternedsize py.getunicodeinternedsize 73 func Getunicodeinternedsize() *py.Object 74 75 // Return the encoding used to convert Unicode filenames to OS filenames. 76 // 77 //go:linkname Getfilesystemencoding py.getfilesystemencoding 78 func Getfilesystemencoding() *py.Object 79 80 // Return the error mode used Unicode to OS filename conversion. 81 // 82 //go:linkname Getfilesystemencodeerrors py.getfilesystemencodeerrors 83 func Getfilesystemencodeerrors() *py.Object 84 85 // Return the reference count of object. 86 // 87 // The count returned is generally one higher than you might expect, 88 // because it includes the (temporary) reference as an argument to 89 // getrefcount(). 90 // 91 //go:linkname Getrefcount py.getrefcount 92 func Getrefcount(object *py.Object) *py.Object 93 94 // Return the current value of the recursion limit. 95 // 96 // The recursion limit is the maximum depth of the Python interpreter 97 // stack. This limit prevents infinite recursion from causing an overflow 98 // of the C stack and crashing Python. 99 // 100 //go:linkname Getrecursionlimit py.getrecursionlimit 101 func Getrecursionlimit() *py.Object 102 103 // “Intern” the given string. 104 // 105 // This enters the string in the (global) table of interned strings whose 106 // purpose is to speed up dictionary lookups. Return the string itself or 107 // the previously interned string object with the same value. 108 // 109 //go:linkname Intern py.intern 110 func Intern(string *py.Object) *py.Object 111 112 // Return True if Python is exiting. 113 // 114 //go:linkname IsFinalizing py.is_finalizing 115 func IsFinalizing() *py.Object 116 117 // Set the ideal thread switching delay inside the Python interpreter. 118 // 119 // The actual frequency of switching threads can be lower if the 120 // interpreter executes long sequences of uninterruptible code 121 // (this is implementation-specific and workload-dependent). 122 // 123 // The parameter must represent the desired switching delay in seconds 124 // A typical value is 0.005 (5 milliseconds). 125 // 126 //go:linkname Setswitchinterval py.setswitchinterval 127 func Setswitchinterval(interval *py.Object) *py.Object 128 129 // Return the current thread switch interval; see sys.setswitchinterval(). 130 // 131 //go:linkname Getswitchinterval py.getswitchinterval 132 func Getswitchinterval() *py.Object 133 134 // Set the flags used by the interpreter for dlopen calls. 135 // 136 // This is used, for example, when the interpreter loads extension 137 // modules. Among other things, this will enable a lazy resolving of 138 // symbols when importing a module, if called as sys.setdlopenflags(0). 139 // To share symbols across extension modules, call as 140 // sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag 141 // modules can be found in the os module (RTLD_xxx constants, e.g. 142 // os.RTLD_LAZY). 143 // 144 //go:linkname Setdlopenflags py.setdlopenflags 145 func Setdlopenflags(flags *py.Object) *py.Object 146 147 // Set the maximum depth of the Python interpreter stack to n. 148 // 149 // This limit prevents infinite recursion from causing an overflow of the C 150 // stack and crashing Python. The highest possible limit is platform- 151 // dependent. 152 // 153 //go:linkname Setrecursionlimit py.setrecursionlimit 154 func Setrecursionlimit(limit *py.Object) *py.Object 155 156 // Return the global debug tracing function set with sys.settrace. 157 // 158 // See the debugger chapter in the library manual. 159 // 160 //go:linkname Gettrace py.gettrace 161 func Gettrace() *py.Object 162 163 // Call func(*args), while tracing is enabled. 164 // 165 // The tracing state is saved, and restored afterwards. This is intended 166 // to be called from a debugger from a checkpoint, to recursively debug 167 // some other code. 168 // 169 //go:linkname CallTracing py.call_tracing 170 func CallTracing(func_ *py.Object, args *py.Object) *py.Object 171 172 // Enable or disable origin tracking for coroutine objects in this thread. 173 // 174 // Coroutine objects will track 'depth' frames of traceback information 175 // about where they came from, available in their cr_origin attribute. 176 // 177 // Set a depth of 0 to disable. 178 // 179 //go:linkname SetCoroutineOriginTrackingDepth py.set_coroutine_origin_tracking_depth 180 func SetCoroutineOriginTrackingDepth(depth *py.Object) *py.Object 181 182 // Check status of origin tracking for coroutine objects in this thread. 183 // 184 //go:linkname GetCoroutineOriginTrackingDepth py.get_coroutine_origin_tracking_depth 185 func GetCoroutineOriginTrackingDepth() *py.Object 186 187 // Deactivate the current stack profiler trampoline backend. 188 // 189 // If no stack profiler is activated, this function has no effect. 190 // 191 //go:linkname DeactivateStackTrampoline py.deactivate_stack_trampoline 192 func DeactivateStackTrampoline() *py.Object 193 194 // Return *True* if a stack profiler trampoline is active. 195 // 196 //go:linkname IsStackTrampolineActive py.is_stack_trampoline_active 197 func IsStackTrampolineActive() *py.Object 198 199 // Handle an unraisable exception. 200 // 201 // The unraisable argument has the following attributes: 202 // 203 // * exc_type: Exception type. 204 // * exc_value: Exception value, can be None. 205 // * exc_traceback: Exception traceback, can be None. 206 // * err_msg: Error message, can be None. 207 // * object: Object causing the exception, can be None. 208 // 209 //go:linkname Unraisablehook py.unraisablehook 210 func Unraisablehook(unraisable *py.Object) *py.Object 211 212 // Return the maximum string digits limit for non-binary int<->str conversions. 213 // 214 //go:linkname GetIntMaxStrDigits py.get_int_max_str_digits 215 func GetIntMaxStrDigits() *py.Object 216 217 // Set the maximum string digits limit for non-binary int<->str conversions. 218 // 219 //go:linkname SetIntMaxStrDigits py.set_int_max_str_digits 220 func SetIntMaxStrDigits(maxdigits *py.Object) *py.Object