sys

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const LLGoPackage = "py.sys"

Variables

This section is empty.

Functions

func Addaudithook

func Addaudithook(hook *py.Object) *py.Object

Adds a new audit hook callback.

func CallTracing

func CallTracing(func_ *py.Object, args *py.Object) *py.Object

Call func(*args), while tracing is enabled.

The tracing state is saved, and restored afterwards. This is intended to be called from a debugger from a checkpoint, to recursively debug some other code.

func DeactivateStackTrampoline

func DeactivateStackTrampoline() *py.Object

Deactivate the current stack profiler trampoline backend.

If no stack profiler is activated, this function has no effect.

func Displayhook

func Displayhook(object *py.Object) *py.Object

Print an object to sys.stdout and also save it in builtins._

func ExcInfo

func ExcInfo() *py.Object

Return current exception information: (type, value, traceback).

Return information about the most recent exception caught by an except clause in the current stack frame or in an older stack frame.

func Excepthook

func Excepthook(exctype *py.Object, value *py.Object, traceback *py.Object) *py.Object

Handle an exception by displaying it with a traceback on sys.stderr.

func Exception

func Exception() *py.Object

Return the current exception.

Return the most recent exception caught by an except clause in the current stack frame or in an older stack frame, or None if no such exception exists.

func Exit

func Exit(status *py.Object) *py.Object

Exit the interpreter by raising SystemExit(status).

If the status is omitted or None, it defaults to zero (i.e., success). If the status is an integer, it will be used as the system exit status. If it is another kind of object, it will be printed and the system exit status will be one (i.e., failure).

func GetCoroutineOriginTrackingDepth

func GetCoroutineOriginTrackingDepth() *py.Object

Check status of origin tracking for coroutine objects in this thread.

func GetIntMaxStrDigits

func GetIntMaxStrDigits() *py.Object

Return the maximum string digits limit for non-binary int<->str conversions.

func Getallocatedblocks

func Getallocatedblocks() *py.Object

Return the number of memory blocks currently allocated.

func Getdefaultencoding

func Getdefaultencoding() *py.Object

Return the current default encoding used by the Unicode implementation.

func Getdlopenflags

func Getdlopenflags() *py.Object

Return the current value of the flags that are used for dlopen calls.

The flag constants are defined in the os module.

func Getfilesystemencodeerrors

func Getfilesystemencodeerrors() *py.Object

Return the error mode used Unicode to OS filename conversion.

func Getfilesystemencoding

func Getfilesystemencoding() *py.Object

Return the encoding used to convert Unicode filenames to OS filenames.

func Getrecursionlimit

func Getrecursionlimit() *py.Object

Return the current value of the recursion limit.

The recursion limit is the maximum depth of the Python interpreter stack. This limit prevents infinite recursion from causing an overflow of the C stack and crashing Python.

func Getrefcount

func Getrefcount(object *py.Object) *py.Object

Return the reference count of object.

The count returned is generally one higher than you might expect, because it includes the (temporary) reference as an argument to getrefcount().

func Getswitchinterval

func Getswitchinterval() *py.Object

Return the current thread switch interval; see sys.setswitchinterval().

func Gettrace

func Gettrace() *py.Object

Return the global debug tracing function set with sys.settrace.

See the debugger chapter in the library manual.

func Getunicodeinternedsize

func Getunicodeinternedsize() *py.Object

Return the number of elements of the unicode interned dictionary

func Intern

func Intern(string *py.Object) *py.Object

“Intern” the given string.

This enters the string in the (global) table of interned strings whose purpose is to speed up dictionary lookups. Return the string itself or the previously interned string object with the same value.

func IsFinalizing

func IsFinalizing() *py.Object

Return True if Python is exiting.

func IsStackTrampolineActive

func IsStackTrampolineActive() *py.Object

Return *True* if a stack profiler trampoline is active.

func SetCoroutineOriginTrackingDepth

func SetCoroutineOriginTrackingDepth(depth *py.Object) *py.Object

Enable or disable origin tracking for coroutine objects in this thread.

Coroutine objects will track 'depth' frames of traceback information about where they came from, available in their cr_origin attribute.

Set a depth of 0 to disable.

func SetIntMaxStrDigits

func SetIntMaxStrDigits(maxdigits *py.Object) *py.Object

Set the maximum string digits limit for non-binary int<->str conversions.

func Setdlopenflags

func Setdlopenflags(flags *py.Object) *py.Object

Set the flags used by the interpreter for dlopen calls.

This is used, for example, when the interpreter loads extension modules. Among other things, this will enable a lazy resolving of symbols when importing a module, if called as sys.setdlopenflags(0). To share symbols across extension modules, call as sys.setdlopenflags(os.RTLD_GLOBAL). Symbolic names for the flag modules can be found in the os module (RTLD_xxx constants, e.g. os.RTLD_LAZY).

func Setrecursionlimit

func Setrecursionlimit(limit *py.Object) *py.Object

Set the maximum depth of the Python interpreter stack to n.

This limit prevents infinite recursion from causing an overflow of the C stack and crashing Python. The highest possible limit is platform- dependent.

func Setswitchinterval

func Setswitchinterval(interval *py.Object) *py.Object

Set the ideal thread switching delay inside the Python interpreter.

The actual frequency of switching threads can be lower if the interpreter executes long sequences of uninterruptible code (this is implementation-specific and workload-dependent).

The parameter must represent the desired switching delay in seconds A typical value is 0.005 (5 milliseconds).

func Unraisablehook

func Unraisablehook(unraisable *py.Object) *py.Object

Handle an unraisable exception.

The unraisable argument has the following attributes:

* exc_type: Exception type. * exc_value: Exception value, can be None. * exc_traceback: Exception traceback, can be None. * err_msg: Error message, can be None. * object: Object causing the exception, can be None.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL