py

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

py

GoDoc GitHub release LLGo XGo

LLGo bindings for the Python/C API, enabling XGo/Go programs to embed a Python interpreter, execute Python code, and exchange objects between host and script.

Documentation

Index

Constants

View Source
const (
	X_Status_TYPE_OK    _llcppg_anon_4 = 0
	X_Status_TYPE_ERROR _llcppg_anon_4 = 1
	X_Status_TYPE_EXIT  _llcppg_anon_4 = 2
)
View Source
const ABI_STRING = "3"
View Source
const ABI_VERSION = 3
View Source
const ALIGNOF_LONG = 8
View Source
const ALIGNOF_MAX_ALIGN_T = 8
View Source
const ALIGNOF_SIZE_T = 8
View Source
const API_STRING = "1013"
View Source
const API_VERSION = 1013
View Source
const ASNATIVEBYTES_ALLOW_INDEX = 16
View Source
const ASNATIVEBYTES_BIG_ENDIAN = 0
View Source
const ASNATIVEBYTES_DEFAULTS = -1
View Source
const ASNATIVEBYTES_LITTLE_ENDIAN = 1
View Source
const ASNATIVEBYTES_NATIVE_ENDIAN = 3
View Source
const ASNATIVEBYTES_REJECT_NEGATIVE = 8
View Source
const ASNATIVEBYTES_UNSIGNED_BUFFER = 4
View Source
const AUDIT_READ = 2
View Source
const AmAiter = 78
View Source
const AmAnext = 79
View Source
const AmAwait = 77
View Source
const AmSend = 81
View Source
const BIG_ENDIAN = 0
View Source
const BUF_ANY_CONTIGUOUS = 152
View Source
const BUF_CONTIG = 9
View Source
const BUF_CONTIG_RO = 8
View Source
const BUF_C_CONTIGUOUS = 56
View Source
const BUF_FORMAT = 4
View Source
const BUF_FULL = 285
View Source
const BUF_FULL_RO = 284
View Source
const BUF_F_CONTIGUOUS = 88
View Source
const BUF_INDIRECT = 280
View Source
const BUF_MAX_NDIM = 64
View Source
const BUF_ND = 8
View Source
const BUF_READ = 256
View Source
const BUF_RECORDS = 29
View Source
const BUF_RECORDS_RO = 28
View Source
const BUF_SIMPLE = 0
View Source
const BUF_STRIDED = 25
View Source
const BUF_STRIDED_RO = 24
View Source
const BUF_STRIDES = 24
View Source
const BUF_WRITABLE = 1
View Source
const BUF_WRITE = 512
View Source
const BUF_WRITEABLE = 1
View Source
const BUILTIN_HASHLIB_HASHES = "md5,sha1,sha2,sha3,blake2"
View Source
const BfGetbuffer = 1
View Source
const BfReleasebuffer = 2
View Source
const CAN_START_THREADS = 1
View Source
const CF_ALLOW_INCOMPLETE_INPUT = 16384
View Source
const CF_ALLOW_TOP_LEVEL_AWAIT = 8192
View Source
const CF_COMPILE_MASK = 62976
View Source
const CF_DONT_IMPLY_DEDENT = 512
View Source
const CF_IGNORE_COOKIE = 2048
View Source
const CF_MASK = 33423360
View Source
const CF_MASK_OBSOLETE = 16
View Source
const CF_ONLY_AST = 1024
View Source
const CF_OPTIMIZED_AST = 33792
View Source
const CF_SOURCE_IS_UTF8 = 256
View Source
const CF_TYPE_COMMENTS = 4096
View Source
const CLEANUP_SUPPORTED = 131072
View Source
const COERCE_C_LOCALE = 1
View Source
const CONSTANT_ELLIPSIS = 3
View Source
const CONSTANT_EMPTY_BYTES = 8
View Source
const CONSTANT_EMPTY_STR = 7
View Source
const CONSTANT_EMPTY_TUPLE = 9
View Source
const CONSTANT_FALSE = 1
View Source
const CONSTANT_NONE = 0
View Source
const CONSTANT_NOT_IMPLEMENTED = 4
View Source
const CONSTANT_ONE = 6
View Source
const CONSTANT_TRUE = 2
View Source
const CONSTANT_ZERO = 5
View Source
const CO_ASYNC_GENERATOR = 512
View Source
const CO_COROUTINE = 128
View Source
const CO_FUTURE_ABSOLUTE_IMPORT = 262144
View Source
const CO_FUTURE_ANNOTATIONS = 16777216
View Source
const CO_FUTURE_BARRY_AS_BDFL = 4194304
View Source
const CO_FUTURE_DIVISION = 131072
View Source
const CO_FUTURE_GENERATOR_STOP = 8388608
View Source
const CO_FUTURE_PRINT_FUNCTION = 1048576
View Source
const CO_FUTURE_UNICODE_LITERALS = 2097152
View Source
const CO_FUTURE_WITH_STATEMENT = 524288
View Source
const CO_GENERATOR = 32
View Source
const CO_HAS_DOCSTRING = 67108864
View Source
const CO_ITERABLE_COROUTINE = 256
View Source
const CO_MAXBLOCKS = 21
View Source
const CO_METHOD = 134217728
View Source
const CO_NESTED = 16
View Source
const CO_NEWLOCALS = 2
View Source
const CO_NO_MONITORING_EVENTS = 33554432
View Source
const CO_OPTIMIZED = 1
View Source
const CO_VARARGS = 4
View Source
const CO_VARKEYWORDS = 8
View Source
const CTF_ALNUM = 7
View Source
const CTF_ALPHA = 3
View Source
const CTF_DIGIT = 4
View Source
const CTF_LOWER = 1
View Source
const CTF_SPACE = 8
View Source
const CTF_UPPER = 2
View Source
const CTF_XDIGIT = 16
View Source
const DOUBLE_IS_LITTLE_ENDIAN_IEEE754 = 1
View Source
const DTSF_ADD_DOT_0 = 2
View Source
const DTSF_ALT = 4
View Source
const DTSF_NO_NEG_0 = 8
View Source
const DTSF_SIGN = 1
View Source
const DTST_FINITE = 0
View Source
const DTST_INFINITE = 1
View Source
const DTST_NAN = 2
View Source
const ENABLE_IPV6 = 1
View Source
const EQ = 2
View Source
const EvalInput = 258
View Source
const FORMAT_SIZE_T = "z"
View Source
const FUTURE_ABSOLUTE_IMPORT = "absolute_import"
View Source
const FUTURE_ANNOTATIONS = "annotations"
View Source
const FUTURE_BARRY_AS_BDFL = "barry_as_FLUFL"
View Source
const FUTURE_DIVISION = "division"
View Source
const FUTURE_GENERATORS = "generators"
View Source
const FUTURE_GENERATOR_STOP = "generator_stop"
View Source
const FUTURE_NESTED_SCOPES = "nested_scopes"
View Source
const FUTURE_PRINT_FUNCTION = "print_function"
View Source
const FUTURE_UNICODE_LITERALS = "unicode_literals"
View Source
const FUTURE_WITH_STATEMENT = "with_statement"
View Source
const FVC_ASCII = 3
View Source
const FVC_MASK = 3
View Source
const FVC_NONE = 0
View Source
const FVC_REPR = 2
View Source
const FVC_STR = 1
View Source
const FVS_HAVE_SPEC = 4
View Source
const FVS_MASK = 4
View Source
const FileInput = 257
View Source
const FuncTypeInput = 345
View Source
const GE = 5
View Source
const GT = 4
View Source
const HASH_ALGORITHM = 3
View Source
const HASH_BITS = 61
View Source
const HASH_CUTOFF = 0
View Source
const HASH_EXTERNAL = 0
View Source
const HASH_FNV = 2
View Source
const HASH_INF = 314159
View Source
const HASH_SIPHASH13 = 3
View Source
const HASH_SIPHASH24 = 1
View Source
const HAVE_ACCEPT = 1
View Source
const HAVE_ACOSH = 1
View Source
const HAVE_ADDRINFO = 1
View Source
const HAVE_ALARM = 1
View Source
const HAVE_ALLOCA_H = 1
View Source
const HAVE_ASINH = 1
View Source
const HAVE_ATANH = 1
View Source
const HAVE_BACKTRACE = 1
View Source
const HAVE_BIND = 1
View Source
const HAVE_BROKEN_SEM_GETVALUE = 1
View Source
const HAVE_BUILTIN_ATOMIC = 1
View Source
const HAVE_CHFLAGS = 1
View Source
const HAVE_CHMOD = 1
View Source
const HAVE_CHOWN = 1
View Source
const HAVE_CHROOT = 1
View Source
const HAVE_CLOCK = 1
View Source
const HAVE_CLOCK_GETRES = 1
View Source
const HAVE_CLOCK_GETTIME = 1
View Source
const HAVE_CLOCK_SETTIME = 1
View Source
const HAVE_CLOCK_T = 1
View Source
const HAVE_COMPUTED_GOTOS = 1
View Source
const HAVE_CONFSTR = 1
View Source
const HAVE_CONNECT = 1
View Source
const HAVE_CTERMID = 1
View Source
const HAVE_CTERMID_R = 1
View Source
const HAVE_CURSES_ESCDELAY = 1
View Source
const HAVE_CURSES_FILTER = 1
View Source
const HAVE_CURSES_GETMOUSE = 1
View Source
const HAVE_CURSES_H = 1
View Source
const HAVE_CURSES_HAS_KEY = 1
View Source
const HAVE_CURSES_IMMEDOK = 1
View Source
const HAVE_CURSES_IS_PAD = 1
View Source
const HAVE_CURSES_IS_TERM_RESIZED = 1
View Source
const HAVE_CURSES_RESIZETERM = 1
View Source
const HAVE_CURSES_RESIZE_TERM = 1
View Source
const HAVE_CURSES_SET_ESCDELAY = 1
View Source
const HAVE_CURSES_SET_TABSIZE = 1
View Source
const HAVE_CURSES_SYNCOK = 1
View Source
const HAVE_CURSES_TABSIZE = 1
View Source
const HAVE_CURSES_TYPEAHEAD = 1
View Source
const HAVE_CURSES_USE_ENV = 1
View Source
const HAVE_CURSES_WCHGAT = 1
View Source
const HAVE_DB_H = 1
View Source
const HAVE_DECL_RTLD_DEEPBIND = 0
View Source
const HAVE_DECL_RTLD_GLOBAL = 1
View Source
const HAVE_DECL_RTLD_LAZY = 1
View Source
const HAVE_DECL_RTLD_LOCAL = 1
View Source
const HAVE_DECL_RTLD_MEMBER = 0
View Source
const HAVE_DECL_RTLD_NODELETE = 1
View Source
const HAVE_DECL_RTLD_NOLOAD = 1
View Source
const HAVE_DECL_RTLD_NOW = 1
View Source
const HAVE_DECL_UT_NAMESIZE = 1
View Source
const HAVE_DEVICE_MACROS = 1
View Source
const HAVE_DEV_PTMX = 1
View Source
const HAVE_DIRENT_D_TYPE = 1
View Source
const HAVE_DIRENT_H = 1
View Source
const HAVE_DIRFD = 1
View Source
const HAVE_DLADDR = 1
View Source
const HAVE_DLFCN_H = 1
View Source
const HAVE_DLOPEN = 1
View Source
const HAVE_DUP = 1
View Source
const HAVE_DUP2 = 1
View Source
const HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH = 1
View Source
const HAVE_DYNAMIC_LOADING = 1
View Source
const HAVE_ERF = 1
View Source
const HAVE_ERFC = 1
View Source
const HAVE_ERRNO_H = 1
View Source
const HAVE_EXECINFO_H = 1
View Source
const HAVE_EXECV = 1
View Source
const HAVE_EXPM1 = 1
View Source
const HAVE_FACCESSAT = 1
View Source
const HAVE_FCHDIR = 1
View Source
const HAVE_FCHMOD = 1
View Source
const HAVE_FCHMODAT = 1
View Source
const HAVE_FCHOWN = 1
View Source
const HAVE_FCHOWNAT = 1
View Source
const HAVE_FCNTL_H = 1
View Source
const HAVE_FDOPENDIR = 1
View Source
const HAVE_FFI_CLOSURE_ALLOC = 1
View Source
const HAVE_FFI_PREP_CIF_VAR = 1
View Source
const HAVE_FFI_PREP_CLOSURE_LOC = 1
View Source
const HAVE_FLOCK = 1
View Source
const HAVE_FORK = 1
View Source
const HAVE_FORKPTY = 1
View Source
const HAVE_FPATHCONF = 1
View Source
const HAVE_FSEEKO = 1
View Source
const HAVE_FSTATAT = 1
View Source
const HAVE_FSTATVFS = 1
View Source
const HAVE_FSYNC = 1
View Source
const HAVE_FTELLO = 1
View Source
const HAVE_FTIME = 1
View Source
const HAVE_FTRUNCATE = 1
View Source
const HAVE_FUTIMENS = 1
View Source
const HAVE_FUTIMES = 1
View Source
const HAVE_GAI_STRERROR = 1
View Source
const HAVE_GCC_UINT128_T = 1
View Source
const HAVE_GETADDRINFO = 1
View Source
const HAVE_GETC_UNLOCKED = 1
View Source
const HAVE_GETEGID = 1
View Source
const HAVE_GETENTROPY = 1
View Source
const HAVE_GETEUID = 1
View Source
const HAVE_GETGID = 1
View Source
const HAVE_GETGRENT = 1
View Source
const HAVE_GETGRGID = 1
View Source
const HAVE_GETGRGID_R = 1
View Source
const HAVE_GETGRNAM_R = 1
View Source
const HAVE_GETGROUPLIST = 1
View Source
const HAVE_GETGROUPS = 1
View Source
const HAVE_GETHOSTBYADDR = 1
View Source
const HAVE_GETHOSTBYNAME = 1
View Source
const HAVE_GETHOSTNAME = 1
View Source
const HAVE_GETITIMER = 1
View Source
const HAVE_GETLOADAVG = 1
View Source
const HAVE_GETLOGIN = 1
View Source
const HAVE_GETLOGIN_R = 1
View Source
const HAVE_GETNAMEINFO = 1
View Source
const HAVE_GETPAGESIZE = 1
View Source
const HAVE_GETPEERNAME = 1
View Source
const HAVE_GETPGID = 1
View Source
const HAVE_GETPGRP = 1
View Source
const HAVE_GETPID = 1
View Source
const HAVE_GETPPID = 1
View Source
const HAVE_GETPRIORITY = 1
View Source
const HAVE_GETPROTOBYNAME = 1
View Source
const HAVE_GETPWENT = 1
View Source
const HAVE_GETPWNAM_R = 1
View Source
const HAVE_GETPWUID = 1
View Source
const HAVE_GETPWUID_R = 1
View Source
const HAVE_GETRUSAGE = 1
View Source
const HAVE_GETSERVBYNAME = 1
View Source
const HAVE_GETSERVBYPORT = 1
View Source
const HAVE_GETSID = 1
View Source
const HAVE_GETSOCKNAME = 1
View Source
const HAVE_GETUID = 1
View Source
const HAVE_GETWD = 1
View Source
const HAVE_GRANTPT = 1
View Source
const HAVE_GRP_H = 1
View Source
const HAVE_HSTRERROR = 1
View Source
const HAVE_IF_NAMEINDEX = 1
View Source
const HAVE_INET_ATON = 1
View Source
const HAVE_INET_NTOA = 1
View Source
const HAVE_INET_PTON = 1
View Source
const HAVE_INITGROUPS = 1
View Source
const HAVE_INTTYPES_H = 1
View Source
const HAVE_KILL = 1
View Source
const HAVE_KILLPG = 1
View Source
const HAVE_KQUEUE = 1
View Source
const HAVE_LANGINFO_H = 1
View Source
const HAVE_LCHFLAGS = 1
View Source
const HAVE_LCHMOD = 1
View Source
const HAVE_LCHOWN = 1
View Source
const HAVE_LIBDL = 1
View Source
const HAVE_LIBSQLITE3 = 1
View Source
const HAVE_LINK = 1
View Source
const HAVE_LINKAT = 1
View Source
const HAVE_LISTEN = 1
View Source
const HAVE_LOCKF = 1
View Source
const HAVE_LOG1P = 1
View Source
const HAVE_LOG2 = 1
View Source
const HAVE_LOGIN_TTY = 1
View Source
const HAVE_LONG_DOUBLE = 1
View Source
const HAVE_LONG_LONG = 1
View Source
const HAVE_LSTAT = 1
View Source
const HAVE_LUTIMES = 1
View Source
const HAVE_MADVISE = 1
View Source
const HAVE_MAKEDEV = 1
View Source
const HAVE_MAXLOGNAME = 1
View Source
const HAVE_MBRTOWC = 1
View Source
const HAVE_MKDIRAT = 1
View Source
const HAVE_MKFIFO = 1
View Source
const HAVE_MKFIFOAT = 1
View Source
const HAVE_MKNOD = 1
View Source
const HAVE_MKNODAT = 1
View Source
const HAVE_MKTIME = 1
View Source
const HAVE_MMAP = 1
View Source
const HAVE_NANOSLEEP = 1
View Source
const HAVE_NCURSESW = 1
View Source
const HAVE_NCURSES_H = 1
View Source
const HAVE_NDBM_H = 1
View Source
const HAVE_NETDB_H = 1
View Source
const HAVE_NETINET_IN_H = 1
View Source
const HAVE_NET_ETHERNET_H = 1
View Source
const HAVE_NET_IF_H = 1
View Source
const HAVE_NICE = 1
View Source
const HAVE_OPENAT = 1
View Source
const HAVE_OPENDIR = 1
View Source
const HAVE_OPENPTY = 1
View Source
const HAVE_PANEL_H = 1
View Source
const HAVE_PATHCONF = 1
View Source
const HAVE_PAUSE = 1
View Source
const HAVE_PIPE = 1
View Source
const HAVE_POLL = 1
View Source
const HAVE_POLL_H = 1
View Source
const HAVE_POSIX_OPENPT = 1
View Source
const HAVE_POSIX_SPAWN = 1
View Source
const HAVE_POSIX_SPAWNP = 1
View Source
const HAVE_PREAD = 1
View Source
const HAVE_PREADV = 1
View Source
const HAVE_PROTOTYPES = 1
View Source
const HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP = 1
View Source
const HAVE_PTHREAD_GETNAME_NP = 1
View Source
const HAVE_PTHREAD_H = 1
View Source
const HAVE_PTHREAD_KILL = 1
View Source
const HAVE_PTHREAD_SETNAME_NP = 1
View Source
const HAVE_PTHREAD_SIGMASK = 1
View Source
const HAVE_PTSNAME = 1
View Source
const HAVE_PTSNAME_R = 1
View Source
const HAVE_PWRITE = 1
View Source
const HAVE_PWRITEV = 1
View Source
const HAVE_READLINK = 1
View Source
const HAVE_READLINKAT = 1
View Source
const HAVE_READV = 1
View Source
const HAVE_REALPATH = 1
View Source
const HAVE_RECVFROM = 1
View Source
const HAVE_RENAMEAT = 1
View Source
const HAVE_RL_COMPLETION_APPEND_CHARACTER = 1
View Source
const HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK = 1
View Source
const HAVE_RL_COMPLETION_MATCHES = 1
View Source
const HAVE_RL_PRE_INPUT_HOOK = 1
View Source
const HAVE_SCHED_GET_PRIORITY_MAX = 1
View Source
const HAVE_SCHED_H = 1
View Source
const HAVE_SEM_GETVALUE = 1
View Source
const HAVE_SEM_OPEN = 1
View Source
const HAVE_SEM_UNLINK = 1
View Source
const HAVE_SENDFILE = 1
View Source
const HAVE_SENDTO = 1
View Source
const HAVE_SETEGID = 1
View Source
const HAVE_SETEUID = 1
View Source
const HAVE_SETGID = 1
View Source
const HAVE_SETGROUPS = 1
View Source
const HAVE_SETHOSTNAME = 1
View Source
const HAVE_SETITIMER = 1
View Source
const HAVE_SETJMP_H = 1
View Source
const HAVE_SETLOCALE = 1
View Source
const HAVE_SETPGID = 1
View Source
const HAVE_SETPGRP = 1
View Source
const HAVE_SETPRIORITY = 1
View Source
const HAVE_SETREGID = 1
View Source
const HAVE_SETREUID = 1
View Source
const HAVE_SETSID = 1
View Source
const HAVE_SETSOCKOPT = 1
View Source
const HAVE_SETUID = 1
View Source
const HAVE_SETVBUF = 1
View Source
const HAVE_SHM_OPEN = 1
View Source
const HAVE_SHM_UNLINK = 1
View Source
const HAVE_SHUTDOWN = 1
View Source
const HAVE_SIGACTION = 1
View Source
const HAVE_SIGALTSTACK = 1
View Source
const HAVE_SIGFILLSET = 1
View Source
const HAVE_SIGINFO_T_SI_BAND = 1
View Source
const HAVE_SIGINTERRUPT = 1
View Source
const HAVE_SIGNAL_H = 1
View Source
const HAVE_SIGPENDING = 1
View Source
const HAVE_SIGRELSE = 1
View Source
const HAVE_SIGWAIT = 1
View Source
const HAVE_SNPRINTF = 1
View Source
const HAVE_SOCKADDR_SA_LEN = 1
View Source
const HAVE_SOCKADDR_STORAGE = 1
View Source
const HAVE_SOCKET = 1
View Source
const HAVE_SOCKETPAIR = 1
View Source
const HAVE_SOCKLEN_T = 1
View Source
const HAVE_SPAWN_H = 1
View Source
const HAVE_SSIZE_T = 1
View Source
const HAVE_STATVFS = 1
View Source
const HAVE_STAT_TV_NSEC2 = 1
View Source
const HAVE_STDINT_H = 1
View Source
const HAVE_STDIO_H = 1
View Source
const HAVE_STDLIB_H = 1
View Source
const HAVE_STD_ATOMIC = 1
View Source
const HAVE_STRFTIME = 1
View Source
const HAVE_STRINGS_H = 1
View Source
const HAVE_STRING_H = 1
View Source
const HAVE_STRLCPY = 1
View Source
const HAVE_STRSIGNAL = 1
View Source
const HAVE_STRUCT_PASSWD_PW_GECOS = 1
View Source
const HAVE_STRUCT_PASSWD_PW_PASSWD = 1
View Source
const HAVE_STRUCT_STAT_ST_BIRTHTIME = 1
View Source
const HAVE_STRUCT_STAT_ST_BLKSIZE = 1
View Source
const HAVE_STRUCT_STAT_ST_BLOCKS = 1
View Source
const HAVE_STRUCT_STAT_ST_FLAGS = 1
View Source
const HAVE_STRUCT_STAT_ST_GEN = 1
View Source
const HAVE_STRUCT_STAT_ST_RDEV = 1
View Source
const HAVE_STRUCT_TM_TM_ZONE = 1
View Source
const HAVE_SYMLINK = 1
View Source
const HAVE_SYMLINKAT = 1
View Source
const HAVE_SYNC = 1
View Source
const HAVE_SYSCONF = 1
View Source
const HAVE_SYSCTLBYNAME = 1
View Source
const HAVE_SYSEXITS_H = 1
View Source
const HAVE_SYSLOG_H = 1
View Source
const HAVE_SYSTEM = 1
View Source
const HAVE_SYS_EVENT_H = 1
View Source
const HAVE_SYS_FILE_H = 1
View Source
const HAVE_SYS_IOCTL_H = 1
View Source
const HAVE_SYS_KERN_CONTROL_H = 1
View Source
const HAVE_SYS_LOCK_H = 1
View Source
const HAVE_SYS_MMAN_H = 1
View Source
const HAVE_SYS_PARAM_H = 1
View Source
const HAVE_SYS_POLL_H = 1
View Source
const HAVE_SYS_RANDOM_H = 1
View Source
const HAVE_SYS_RESOURCE_H = 1
View Source
const HAVE_SYS_SELECT_H = 1
View Source
const HAVE_SYS_SOCKET_H = 1
View Source
const HAVE_SYS_STATVFS_H = 1
View Source
const HAVE_SYS_STAT_H = 1
View Source
const HAVE_SYS_SYSCALL_H = 1
View Source
const HAVE_SYS_SYSCTL_H = 1
View Source
const HAVE_SYS_SYS_DOMAIN_H = 1
View Source
const HAVE_SYS_TIMES_H = 1
View Source
const HAVE_SYS_TIME_H = 1
View Source
const HAVE_SYS_TYPES_H = 1
View Source
const HAVE_SYS_UIO_H = 1
View Source
const HAVE_SYS_UN_H = 1
View Source
const HAVE_SYS_UTSNAME_H = 1
View Source
const HAVE_SYS_WAIT_H = 1
View Source
const HAVE_SYS_XATTR_H = 1
View Source
const HAVE_TCGETPGRP = 1
View Source
const HAVE_TCSETPGRP = 1
View Source
const HAVE_TEMPNAM = 1
View Source
const HAVE_TERMIOS_H = 1
View Source
const HAVE_TERM_H = 1
View Source
const HAVE_TIMEGM = 1
View Source
const HAVE_TIMES = 1
View Source
const HAVE_TMPFILE = 1
View Source
const HAVE_TMPNAM = 1
View Source
const HAVE_TM_ZONE = 1
View Source
const HAVE_TRUNCATE = 1
View Source
const HAVE_TTYNAME_R = 1
View Source
const HAVE_UMASK = 1
View Source
const HAVE_UNAME = 1
View Source
const HAVE_UNISTD_H = 1
View Source
const HAVE_UNLINKAT = 1
View Source
const HAVE_UNLOCKPT = 1
View Source
const HAVE_UTIL_H = 1
View Source
const HAVE_UTIMENSAT = 1
View Source
const HAVE_UTIMES = 1
View Source
const HAVE_UTIME_H = 1
View Source
const HAVE_UTMP_H = 1
View Source
const HAVE_UT_NAMESIZE = 1
View Source
const HAVE_UUID_UUID_H = 1
View Source
const HAVE_VFORK = 1
View Source
const HAVE_WAIT = 1
View Source
const HAVE_WAIT3 = 1
View Source
const HAVE_WAIT4 = 1
View Source
const HAVE_WAITID = 1
View Source
const HAVE_WAITPID = 1
View Source
const HAVE_WCHAR_H = 1
View Source
const HAVE_WCSCOLL = 1
View Source
const HAVE_WCSFTIME = 1
View Source
const HAVE_WCSXFRM = 1
View Source
const HAVE_WMEMCMP = 1
View Source
const HAVE_WORKING_TZSET = 1
View Source
const HAVE_WRITEV = 1
View Source
const HAVE_ZLIB_COPY = 1
View Source
const HAVE___UINT128_T = 1
View Source
const InterpreterConfig_DEFAULT_GIL = 0
View Source
const InterpreterConfig_OWN_GIL = 2
View Source
const InterpreterConfig_SHARED_GIL = 1
View Source
const LE = 1
View Source
const LITTLE_ENDIAN = 1
View Source
const LLGoPackage = "link: $LLGO_LIB_PYTHON; $(pkg-config --libs python3-embed)"
View Source
const LT = 0
View Source
const Long_SHIFT = 30
View Source
const MAJOR_VERSION = 3
View Source
const MATH_E = 2.718281828459045
View Source
const MATH_PI = 3.141592653589793
View Source
const MAX_CO_EXTRA_USERS = 255
View Source
const METH_CLASS = 16
View Source
const METH_COEXIST = 64
View Source
const METH_FASTCALL = 128
View Source
const METH_KEYWORDS = 2
View Source
const METH_METHOD = 512
View Source
const METH_NOARGS = 4
View Source
const METH_O = 8
View Source
const METH_STACKLESS = 0
View Source
const METH_STATIC = 32
View Source
const METH_VARARGS = 1
View Source
const MICRO_VERSION = 8
View Source
const MINOR_VERSION = 14
View Source
const MONITORING_EVENT_BRANCH = 18
View Source
const MONITORING_EVENT_BRANCH_LEFT = 8
View Source
const MONITORING_EVENT_BRANCH_RIGHT = 9
View Source
const MONITORING_EVENT_CALL = 4
View Source
const MONITORING_EVENT_C_RAISE = 17
View Source
const MONITORING_EVENT_C_RETURN = 16
View Source
const MONITORING_EVENT_EXCEPTION_HANDLED = 12
View Source
const MONITORING_EVENT_INSTRUCTION = 6
View Source
const MONITORING_EVENT_JUMP = 7
View Source
const MONITORING_EVENT_LINE = 5
View Source
const MONITORING_EVENT_PY_RESUME = 1
View Source
const MONITORING_EVENT_PY_RETURN = 2
View Source
const MONITORING_EVENT_PY_START = 0
View Source
const MONITORING_EVENT_PY_THROW = 14
View Source
const MONITORING_EVENT_PY_UNWIND = 13
View Source
const MONITORING_EVENT_PY_YIELD = 3
View Source
const MONITORING_EVENT_RAISE = 11
View Source
const MONITORING_EVENT_RERAISE = 15
View Source
const MONITORING_EVENT_STOP_ITERATION = 10
View Source
const MVWDELCH_IS_EXPRESSION = 1
View Source
const ModCreate = 1
View Source
const ModExec = 2
View Source
const ModGil = 4
View Source
const ModMultipleInterpreters = 3
View Source
const MpAssSubscript = 3
View Source
const MpLength = 4
View Source
const MpSubscript = 5
View Source
const NE = 3
View Source
const NOWAIT_LOCK = 0
View Source
const NbAbsolute = 6
View Source
const NbAdd = 7
View Source
const NbAnd = 8
View Source
const NbBool = 9
View Source
const NbDivmod = 10
View Source
const NbFloat = 11
View Source
const NbFloorDivide = 12
View Source
const NbIndex = 13
View Source
const NbInplaceAdd = 14
View Source
const NbInplaceAnd = 15
View Source
const NbInplaceFloorDivide = 16
View Source
const NbInplaceLshift = 17
View Source
const NbInplaceMatrixMultiply = 76
View Source
const NbInplaceMultiply = 18
View Source
const NbInplaceOr = 19
View Source
const NbInplacePower = 20
View Source
const NbInplaceRemainder = 21
View Source
const NbInplaceRshift = 22
View Source
const NbInplaceSubtract = 23
View Source
const NbInplaceTrueDivide = 24
View Source
const NbInplaceXor = 25
View Source
const NbInt = 26
View Source
const NbInvert = 27
View Source
const NbLshift = 28
View Source
const NbMatrixMultiply = 75
View Source
const NbMultiply = 29
View Source
const NbNegative = 30
View Source
const NbOr = 31
View Source
const NbPositive = 32
View Source
const NbPower = 33
View Source
const NbRemainder = 34
View Source
const NbRshift = 35
View Source
const NbSubtract = 36
View Source
const NbTrueDivide = 37
View Source
const NbXor = 38
View Source
const PRINT_RAW = 1
View Source
const PTHREAD_SYSTEM_SCHED_SUPPORTED = 1
View Source
const PYLONG_BITS_IN_DIGIT = 30
View Source
const READONLY = 1
View Source
const RELATIVE_OFFSET = 8
View Source
const RELEASE_LEVEL = 15
View Source
const RELEASE_LEVEL_ALPHA = 10
View Source
const RELEASE_LEVEL_BETA = 11
View Source
const RELEASE_LEVEL_FINAL = 15
View Source
const RELEASE_LEVEL_GAMMA = 12
View Source
const RELEASE_SERIAL = 0
View Source
const REMOTE_DEBUG = 1
View Source
const RL_STARTUP_HOOK_TAKES_ARGS = 1
View Source
const SIZEOF_DOUBLE = 8
View Source
const SIZEOF_FLOAT = 4
View Source
const SIZEOF_FPOS_T = 8
View Source
const SIZEOF_INT = 4
View Source
const SIZEOF_LONG = 8
View Source
const SIZEOF_LONG_DOUBLE = 8
View Source
const SIZEOF_LONG_LONG = 8
View Source
const SIZEOF_OFF_T = 8
View Source
const SIZEOF_PID_T = 4
View Source
const SIZEOF_PTHREAD_KEY_T = 8
View Source
const SIZEOF_PTHREAD_T = 8
View Source
const SIZEOF_PY_HASH_T = 8
View Source
const SIZEOF_PY_UHASH_T = 8
View Source
const SIZEOF_SHORT = 2
View Source
const SIZEOF_SIZE_T = 8
View Source
const SIZEOF_TIME_T = 8
View Source
const SIZEOF_UINTPTR_T = 8
View Source
const SIZEOF_VOID_P = 8
View Source
const SIZEOF_WCHAR_T = 4
View Source
const SIZEOF__BOOL = 1
View Source
const SQLITE_ENABLE_LOAD_EXTENSION = 1
View Source
const SQLITE_HAVE_SERIALIZE = 1
View Source
const SSL_DEFAULT_CIPHERS = 1
View Source
const SSTATE_INTERNED_IMMORTAL = 2
View Source
const SSTATE_INTERNED_IMMORTAL_STATIC = 3
View Source
const SSTATE_INTERNED_MORTAL = 1
View Source
const SSTATE_NOT_INTERNED = 0
View Source
const STDC_HEADERS = 1
View Source
const STDIOTEXTMODE = "b"
View Source
const SUPPORT_TIER = 1
View Source
const SYS_SELECT_WITH_SYS_TIME = 1
View Source
const Set_MINSIZE = 8
View Source
const SingleInput = 256
View Source
const SqAssItem = 39
View Source
const SqConcat = 40
View Source
const SqContains = 41
View Source
const SqInplaceConcat = 42
View Source
const SqInplaceRepeat = 43
View Source
const SqItem = 44
View Source
const SqLength = 45
View Source
const SqRepeat = 46
View Source
const THREAD_STACK_SIZE = 16777216
View Source
const TPFLAGS_DEFAULT = 0
View Source
const TPFLAGS_HAVE_STACKLESS_EXTENSION = 0
View Source
const TPFLAGS_INLINE_VALUES = 4
View Source
const TPFLAGS_MANAGED_DICT = 16
View Source
const TPFLAGS_MANAGED_WEAKREF = 8
View Source
const TPFLAGS_MAPPING = 64
View Source
const TPFLAGS_PREHEADER = 24
View Source
const TPFLAGS_SEQUENCE = 32
View Source
const T_BOOL = 14
View Source
const T_BYTE = 8
View Source
const T_CHAR = 7
View Source
const T_DOUBLE = 4
View Source
const T_FLOAT = 3
View Source
const T_INT = 1
View Source
const T_LONG = 2
View Source
const T_LONGLONG = 17
View Source
const T_OBJECT_EX = 16
View Source
const T_PYSSIZET = 19
View Source
const T_SHORT = 0
View Source
const T_STRING = 5
View Source
const T_STRING_INPLACE = 13
View Source
const T_UBYTE = 9
View Source
const T_UINT = 11
View Source
const T_ULONG = 12
View Source
const T_ULONGLONG = 18
View Source
const T_USHORT = 10
View Source
const TpAlloc = 47
View Source
const TpBase = 48
View Source
const TpBases = 49
View Source
const TpCall = 50
View Source
const TpClear = 51
View Source
const TpDealloc = 52
View Source
const TpDel = 53
View Source
const TpDescrGet = 54
View Source
const TpDescrSet = 55
View Source
const TpDoc = 56
View Source
const TpFinalize = 80
View Source
const TpFree = 74
View Source
const TpGetattr = 57
View Source
const TpGetattro = 58
View Source
const TpGetset = 73
View Source
const TpHash = 59
View Source
const TpInit = 60
View Source
const TpIsGc = 61
View Source
const TpIter = 62
View Source
const TpIternext = 63
View Source
const TpMembers = 72
View Source
const TpMethods = 64
View Source
const TpNew = 65
View Source
const TpRepr = 66
View Source
const TpRichcompare = 67
View Source
const TpSetattr = 68
View Source
const TpSetattro = 69
View Source
const TpStr = 70
View Source
const TpToken = 83
View Source
const TpTraverse = 71
View Source
const TpVectorcall = 82
View Source
const Trace_CALL = 0
View Source
const Trace_C_CALL = 4
View Source
const Trace_C_EXCEPTION = 5
View Source
const Trace_C_RETURN = 6
View Source
const Trace_EXCEPTION = 1
View Source
const Trace_LINE = 2
View Source
const Trace_OPCODE = 7
View Source
const Trace_RETURN = 3
View Source
const UNICODE_SIZE = 4
View Source
const Unstable_EXECUTABLE_KINDS = 5
View Source
const Unstable_EXECUTABLE_KIND_BUILTIN_FUNCTION = 3
View Source
const Unstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR = 4
View Source
const Unstable_EXECUTABLE_KIND_PY_FUNCTION = 1
View Source
const Unstable_EXECUTABLE_KIND_SKIP = 0
View Source
const VERSION = "3.14.8"
View Source
const WAIT_LOCK = 1
View Source
const WINDOW_HAS_FLAGS = 1
View Source
const WITH_DECIMAL_CONTEXTVAR = 1
View Source
const WITH_DOC_STRINGS = 1
View Source
const WITH_DTRACE = 1
View Source
const WITH_DYLD = 1
View Source
const WITH_EDITLINE = 1
View Source
const WITH_MIMALLOC = 1
View Source
const WITH_NEXT_FRAMEWORK = 1
View Source
const WITH_PYMALLOC = 1
View Source
const WrapperFlag_KEYWORDS = 1
View Source
const XGoPackage = true
View Source
const X_ALL_SOURCE = 1
View Source
const X_ATTR_CACHE_UNUSED = 30000
View Source
const X_DARWIN_C_SOURCE = 1
View Source
const X_DATA_STACK_CHUNK_SIZE = 16384
View Source
const X_FFI_SUPPORT_C_COMPLEX = 1
View Source
const X_FILE_OFFSET_BITS = 64
View Source
const X_GNU_SOURCE = 1
View Source
const X_HASH_BITS = 61
View Source
const X_HASH_INF = 314159
View Source
const X_HPUX_ALT_XOPEN_SOCKET_API = 1
View Source
const X_IMMORTAL_FLAGS = 1
View Source
const X_InterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS = 0
View Source
const X_LARGEFILE_SOURCE = 1
View Source
const X_LOCKED = 1
View Source
const X_Long_DECIMAL_SHIFT = 9
View Source
const X_Long_NON_SIZE_BITS = 3
View Source
const X_Long_SIGN_MASK = 3
View Source
const X_MANAGED_BUFFER_FREE_FORMAT = 2
View Source
const X_MANAGED_BUFFER_RELEASED = 1
View Source
const X_MAX_SCRIPT_PATH_SIZE = 512
View Source
const X_MEMORYVIEW_C = 2
View Source
const X_MEMORYVIEW_FORTRAN = 4
View Source
const X_MEMORYVIEW_PIL = 16
View Source
const X_MEMORYVIEW_RELEASED = 1
View Source
const X_MEMORYVIEW_RESTRICTED = 32
View Source
const X_MEMORYVIEW_SCALAR = 8
View Source
const X_NETBSD_SOURCE = 1
View Source
const X_OPENBSD_SOURCE = 1
View Source
const X_PARSE_INTPTR = "l"
View Source
const X_PARSE_PID = "i"
View Source
const X_PARSE_UINTPTR = "k"
View Source
const X_POSIX_PTHREAD_SEMANTICS = 1
View Source
const X_PYTHONFRAMEWORK = "Python"
View Source
const X_PYTHREAD_NAME_MAXLEN = 63
View Source
const X_REENTRANT = 1
View Source
const X_STACK_GROWS_DOWN = 1
View Source
const X_STATICALLY_ALLOCATED_FLAG = 4
View Source
const X_TANDEM_SOURCE = 1
View Source
const X_TPFLAGS_STATIC_BUILTIN = 2
View Source
const X_T_NONE = 20
View Source
const X_T_OBJECT = 6
View Source
const X_UNLOCKED = 0
View Source
const X_USE_GCC_BUILTIN_ATOMICS = 1
View Source
const X_WRITE_RESTRICTED = 4
View Source
const X__BSD_VISIBLE = 1
View Source
const X__EXTENSIONS__ = 1
View Source
const X__STDC_WANT_IEC_60559_ATTRIBS_EXT__ = 1
View Source
const X__STDC_WANT_IEC_60559_BFP_EXT__ = 1
View Source
const X__STDC_WANT_IEC_60559_DFP_EXT__ = 1
View Source
const X__STDC_WANT_IEC_60559_EXT__ = 1
View Source
const X__STDC_WANT_IEC_60559_FUNCS_EXT__ = 1
View Source
const X__STDC_WANT_IEC_60559_TYPES_EXT__ = 1
View Source
const X__STDC_WANT_LIB_EXT2__ = 1
View Source
const X__STDC_WANT_MATH_SPEC_FUNCS__ = 1
View Source
const X_modLAST_SLOT = 4

Variables

View Source
var BytesWarningFlag c.Int
View Source
var DebugFlag c.Int
View Source
var DontWriteBytecodeFlag c.Int
View Source
var FileSystemDefaultEncodeErrors *c.Char
View Source
var FileSystemDefaultEncoding *c.Char

The default encoding used by the platform file system APIs If non-NULL, this is different than the default encoding for strings

View Source
var FrozenFlag c.Int
View Source
var HasFileSystemDefaultEncoding c.Int
View Source
var HashRandomizationFlag c.Int
View Source
var Hexdigits *c.Char
View Source
var IgnoreEnvironmentFlag c.Int
View Source
var InspectFlag c.Int
View Source
var InteractiveFlag c.Int
View Source
var IsolatedFlag c.Int
View Source
var NoSiteFlag c.Int
View Source
var NoUserSiteDirectory c.Int
View Source
var OS_InputHook func() c.Int

Stuff with no proper home (yet)

View Source
var OS_ReadlineFunctionPointer func(_llcppg_param1 *c.FILE, _llcppg_param2 *c.FILE, _llcppg_param3 *c.Char) *c.Char
View Source
var OptimizeFlag c.Int
View Source
var QuietFlag c.Int
View Source
var StructSequenceUnnamedField *c.Char
View Source
var TIMEOUT_MAX c.LongLong

PY_TIMEOUT_MAX is the highest usable value (in microseconds) of PY_TIMEOUT_T type, and depends on the system threading API.

NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread module exposes a higher-level API, with timeouts expressed in seconds and floating-point numbers allowed.

View Source
var UTF8Mode c.Int
View Source
var UnbufferedStdioFlag c.Int
View Source
var VerboseFlag c.Int
View Source
var Version c.Ulong
View Source
var X_ByteArrayEmptyString *c.Char
View Source
var X_asciiWhitespace *uint8

Helper array used by Py_UNICODE_ISSPACE().

View Source
var X_ctypeTable [256]c.Uint
View Source
var X_ctypeTolower [256]uint8
View Source
var X_ctypeToupper [256]uint8

Functions

func AIterCheck added in v0.2.1

func AIterCheck(_llcppg_param1 *Object) c.Int

Returns non-zero if the object 'obj' provides AsyncIterator protocols, and 0 otherwise.

This function always succeeds.

func AddPendingCall added in v0.2.0

func AddPendingCall(func_ func(_llcppg_param1 unsafe.Pointer) c.Int, arg unsafe.Pointer) c.Int

func ArgParse added in v0.2.1

func ArgParse(_llcppg_param1 *Object, _llcppg_param2 *c.Char, __llgo_va_list ...any) c.Int

func ArgParseTuple added in v0.2.1

func ArgParseTuple(_llcppg_param1 *Object, _llcppg_param2 *c.Char, __llgo_va_list ...any) c.Int

func ArgParseTupleAndKeywords added in v0.2.1

func ArgParseTupleAndKeywords(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *c.Char, _llcppg_param4 **c.Char, __llgo_va_list ...any) c.Int

func ArgUnpackTuple added in v0.2.1

func ArgUnpackTuple(_llcppg_param1 *Object, _llcppg_param2 *c.Char, _llcppg_param3 SsizeT, _llcppg_param4 SsizeT, __llgo_va_list ...any) c.Int

func ArgVaParse added in v0.2.1

func ArgVaParse(_llcppg_param1 *Object, _llcppg_param2 *c.Char, _llcppg_param3 c.VaList) c.Int

func ArgVaParseTupleAndKeywords added in v0.2.1

func ArgVaParseTupleAndKeywords(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *c.Char, _llcppg_param4 **c.Char, _llcppg_param5 c.VaList) c.Int

func ArgValidateKeywordArguments added in v0.2.1

func ArgValidateKeywordArguments(_llcppg_param1 *Object) c.Int

func AtExit added in v0.2.0

func AtExit(func_ func()) c.Int

Py_PyAtExit is for the atexit module, Py_AtExit is for low-level exit functions.

func BufferFillContiguousStrides added in v0.2.0

func BufferFillContiguousStrides(ndims c.Int, shape *SsizeT, strides *SsizeT, itemsize c.Int, fort c.Char)

Fill the strides array with byte-strides of a contiguous (Fortran-style if fort is 'F' or C-style otherwise) array of the given shape with the given number of bytes per element.

func BufferFillInfo added in v0.2.3

func BufferFillInfo(view *Buffer, o *Object, buf unsafe.Pointer, len SsizeT, readonly c.Int, flags c.Int) c.Int

Fills in a buffer-info structure correctly for an exporter that can only share a contiguous chunk of memory of "unsigned bytes" of the given length.

Returns 0 on success and -1 (with raising an error) on error.

func BufferFromContiguous added in v0.2.3

func BufferFromContiguous(view *Buffer, buf unsafe.Pointer, len SsizeT, order c.Char) c.Int

func BufferGetPointer added in v0.2.3

func BufferGetPointer(view *Buffer, indices *SsizeT) unsafe.Pointer

Get the memory area pointed to by the indices for the buffer given. Note that view->ndim is the assumed size of indices.

func BufferIsContiguous added in v0.2.3

func BufferIsContiguous(view *Buffer, fort c.Char) c.Int

Copy the data from the src buffer to the buffer of destination.

func BufferRelease added in v0.2.3

func BufferRelease(view *Buffer)

Releases a Py_buffer obtained from getbuffer ParseTuple's "s*".

func BufferToContiguous added in v0.2.0

func BufferToContiguous(buf unsafe.Pointer, view *Buffer, len SsizeT, order c.Char) c.Int

Implementation in memoryobject.c

func BytesConcat added in v0.2.0

func BytesConcat(_llcppg_param1 **Object, _llcppg_param2 *Object)

func BytesConcatAndDel added in v0.2.0

func BytesConcatAndDel(_llcppg_param1 **Object, _llcppg_param2 *Object)

func BytesMain added in v0.2.0

func BytesMain(argc c.Int, argv **c.Char) c.Int

func CallableCheck added in v0.2.3

func CallableCheck(_llcppg_param1 *Object) c.Int

func CapsuleGetContext added in v0.2.3

func CapsuleGetContext(capsule *Object) unsafe.Pointer

func CapsuleGetName added in v0.2.3

func CapsuleGetName(capsule *Object) *c.Char

func CapsuleGetPointer added in v0.2.3

func CapsuleGetPointer(capsule *Object, name *c.Char) unsafe.Pointer

func CapsuleImport added in v0.2.0

func CapsuleImport(name *c.Char, no_block c.Int) unsafe.Pointer

func CapsuleIsValid added in v0.2.3

func CapsuleIsValid(capsule *Object, name *c.Char) c.Int

func CapsuleSetContext added in v0.2.3

func CapsuleSetContext(capsule *Object, context unsafe.Pointer) c.Int

func CapsuleSetDestructor added in v0.2.3

func CapsuleSetDestructor(capsule *Object, destructor CapsuleDestructor) c.Int

func CapsuleSetName added in v0.2.3

func CapsuleSetName(capsule *Object, name *c.Char) c.Int

func CapsuleSetPointer added in v0.2.3

func CapsuleSetPointer(capsule *Object, pointer unsafe.Pointer) c.Int

func CodeAddWatcher added in v0.2.0

func CodeAddWatcher(callback CodeWatchCallback) c.Int

Register a per-interpreter callback that will be invoked for code object lifecycle events.

Returns a handle that may be passed to PyCode_ClearWatcher on success, or -1 and sets an error if no more handles are available.

func CodeClearWatcher added in v0.2.0

func CodeClearWatcher(watcher_id c.Int) c.Int

Clear the watcher associated with the watcher_id handle.

Returns 0 on success or -1 if no watcher exists for the provided id.

func CodecKnownEncoding added in v0.2.0

func CodecKnownEncoding(encoding *c.Char) c.Int

Codec registry encoding check API.

Returns 1/0 depending on whether there is a registered codec for the given encoding.

func CodecRegister added in v0.2.3

func CodecRegister(search_function *Object) c.Int

Register a new codec search function.

As side effect, this tries to load the encodings package, if not yet done, to make sure that it is always first in the list of search functions.

The search_function's refcount is incremented by this function.

func CodecRegisterError added in v0.2.0

func CodecRegisterError(name *c.Char, error *Object) c.Int

Register the error handling callback function error under the given name. This function will be called by the codec when it encounters unencodable characters/undecodable bytes and doesn't know the callback name, when name is specified as the error parameter in the call to the encode/decode function. Return 0 on success, -1 on error

func CodecUnregister added in v0.2.3

func CodecUnregister(search_function *Object) c.Int

Unregister a codec search function and clear the registry's cache. If the search function is not registered, do nothing. Return 0 on success. Raise an exception and return -1 on error.

func CompileOpcodeStackEffect added in v0.2.0

func CompileOpcodeStackEffect(opcode c.Int, oparg c.Int) c.Int

func CompileOpcodeStackEffectWithJump added in v0.2.0

func CompileOpcodeStackEffectWithJump(opcode c.Int, oparg c.Int, jump c.Int) c.Int

func ConfigClear added in v0.2.3

func ConfigClear(_llcppg_param1 *Config)

func ConfigGetInt added in v0.2.0

func ConfigGetInt(name *c.Char, value *c.Int) c.Int

func ConfigInitIsolatedConfig added in v0.2.3

func ConfigInitIsolatedConfig(config *Config)

func ConfigInitPythonConfig added in v0.2.3

func ConfigInitPythonConfig(config *Config)

func ConfigSet added in v0.2.0

func ConfigSet(name *c.Char, value *Object) c.Int

func ContextAddWatcher added in v0.2.0

func ContextAddWatcher(callback ContextWatchCallback) c.Int

Register a per-interpreter callback that will be invoked for context object enter/exit events.

Returns a handle that may be passed to PyContext_ClearWatcher on success, or -1 and sets and error if no more handles are available.

func ContextClearWatcher added in v0.2.0

func ContextClearWatcher(watcher_id c.Int) c.Int

Clear the watcher associated with the watcher_id handle.

Returns 0 on success or -1 if no watcher exists for the provided id.

func ContextEnter added in v0.2.3

func ContextEnter(_llcppg_param1 *Object) c.Int

func ContextExit added in v0.2.3

func ContextExit(_llcppg_param1 *Object) c.Int

func ContextVarGet added in v0.2.3

func ContextVarGet(var_ *Object, default_value *Object, value **Object) c.Int

Get a value for the variable.

Returns -1 if an error occurred during lookup.

Returns 0 if value either was or was not found.

If value was found, *value will point to it. If not, it will point to:

- default_value, if not NULL; - the default value of "var", if not NULL; - NULL.

'*value' will be a new ref, if not NULL.

func ContextVarReset added in v0.2.3

func ContextVarReset(var_ *Object, token *Object) c.Int

Reset a variable to its previous value. Returns 0 on success, -1 on error.

func CriticalSection2Begin added in v0.2.3

func CriticalSection2Begin(c *CriticalSection2, a *Object, b *Object)

func CriticalSection2BeginMutex added in v0.2.3

func CriticalSection2BeginMutex(c *CriticalSection2, m1 *Mutex, m2 *Mutex)

func CriticalSection2End added in v0.2.3

func CriticalSection2End(c *CriticalSection2)

func CriticalSectionBegin added in v0.2.3

func CriticalSectionBegin(c *CriticalSection, op *Object)

func CriticalSectionBeginMutex added in v0.2.3

func CriticalSectionBeginMutex(c *CriticalSection, m *Mutex)

func CriticalSectionEnd added in v0.2.3

func CriticalSectionEnd(c *CriticalSection)

func DecRef added in v0.2.0

func DecRef(_llcppg_param1 *Object)

func DecodeLocale added in v0.2.0

func DecodeLocale(arg *c.Char, size *c.SizeT) *c.WcharT

func DictAddWatcher added in v0.2.0

func DictAddWatcher(callback DictWatchCallback) c.Int

Register/unregister a dict-watcher callback

func DictClearWatcher added in v0.2.0

func DictClearWatcher(watcher_id c.Int) c.Int

func DictUnwatch added in v0.2.0

func DictUnwatch(watcher_id c.Int, dict *Object) c.Int

func DictWatch added in v0.2.0

func DictWatch(watcher_id c.Int, dict *Object) c.Int

Mark given dictionary as "watched" (callback will be called if it is modified)

func EncodeLocale added in v0.2.0

func EncodeLocale(text *c.WcharT, error_pos *c.SizeT) *c.Char

func EndInterpreter added in v0.2.0

func EndInterpreter(_llcppg_param1 *ThreadState)

func EnterRecursiveCall added in v0.2.0

func EnterRecursiveCall(where *c.Char) c.Int

func ErrBadArgument added in v0.2.0

func ErrBadArgument() c.Int

Convenience functions

func ErrBadInternalCall added in v0.2.0

func ErrBadInternalCall()

Export the old function so that the existing API remains available:

func ErrCheckSignals added in v0.2.0

func ErrCheckSignals() c.Int

In signalmodule.c

func ErrClear added in v0.2.0

func ErrClear()

func ErrDisplay added in v0.2.1

func ErrDisplay(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object)

func ErrDisplayException added in v0.2.1

func ErrDisplayException(_llcppg_param1 *Object)

func ErrExceptionMatches added in v0.2.1

func ErrExceptionMatches(_llcppg_param1 *Object) c.Int

func ErrFetch added in v0.2.0

func ErrFetch(_llcppg_param1 **Object, _llcppg_param2 **Object, _llcppg_param3 **Object)

func ErrFormatUnraisable added in v0.2.0

func ErrFormatUnraisable(_llcppg_param1 *c.Char, __llgo_va_list ...any)

func ErrGetExcInfo added in v0.2.0

func ErrGetExcInfo(_llcppg_param1 **Object, _llcppg_param2 **Object, _llcppg_param3 **Object)

func ErrGivenExceptionMatches added in v0.2.1

func ErrGivenExceptionMatches(_llcppg_param1 *Object, _llcppg_param2 *Object) c.Int

Error testing and normalization

func ErrNormalizeException added in v0.2.0

func ErrNormalizeException(_llcppg_param1 **Object, _llcppg_param2 **Object, _llcppg_param3 **Object)

func ErrPrint added in v0.2.0

func ErrPrint()

func ErrPrintEx added in v0.2.0

func ErrPrintEx(_llcppg_param1 c.Int)

func ErrRangedSyntaxLocationObject added in v0.2.1

func ErrRangedSyntaxLocationObject(filename *Object, lineno c.Int, col_offset c.Int, end_lineno c.Int, end_col_offset c.Int)

func ErrResourceWarning added in v0.2.1

func ErrResourceWarning(source *Object, stack_level SsizeT, format *c.Char, __llgo_va_list ...any) c.Int

Emit a ResourceWarning warning

func ErrRestore added in v0.2.1

func ErrRestore(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object)

func ErrSetExcInfo added in v0.2.1

func ErrSetExcInfo(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object)

func ErrSetHandledException added in v0.2.1

func ErrSetHandledException(_llcppg_param1 *Object)

func ErrSetInterrupt added in v0.2.0

func ErrSetInterrupt()

func ErrSetInterruptEx added in v0.2.0

func ErrSetInterruptEx(signum c.Int) c.Int

func ErrSetNone added in v0.2.1

func ErrSetNone(_llcppg_param1 *Object)

func ErrSetObject added in v0.2.1

func ErrSetObject(_llcppg_param1 *Object, _llcppg_param2 *Object)

func ErrSetRaisedException added in v0.2.1

func ErrSetRaisedException(_llcppg_param1 *Object)

func ErrSetString added in v0.2.1

func ErrSetString(exception *Object, string *c.Char)

func ErrSyntaxLocation added in v0.2.0

func ErrSyntaxLocation(filename *c.Char, lineno c.Int)

Support for adding program text to SyntaxErrors

func ErrSyntaxLocationEx added in v0.2.0

func ErrSyntaxLocationEx(filename *c.Char, lineno c.Int, col_offset c.Int)

func ErrSyntaxLocationObject added in v0.2.1

func ErrSyntaxLocationObject(filename *Object, lineno c.Int, col_offset c.Int)

Support for adding program text to SyntaxErrors

func ErrWarnEx added in v0.2.1

func ErrWarnEx(category *Object, message *c.Char, stack_level SsizeT) c.Int

func ErrWarnExplicit added in v0.2.1

func ErrWarnExplicit(category *Object, message *c.Char, filename *c.Char, lineno c.Int, module *c.Char, registry *Object) c.Int

func ErrWarnExplicitFormat added in v0.2.1

func ErrWarnExplicitFormat(category *Object, filename *c.Char, lineno c.Int, module *c.Char, registry *Object, format *c.Char, __llgo_va_list ...any) c.Int

func ErrWarnExplicitObject added in v0.2.1

func ErrWarnExplicitObject(category *Object, message *Object, filename *Object, lineno c.Int, module *Object, registry *Object) c.Int

func ErrWarnFormat added in v0.2.1

func ErrWarnFormat(category *Object, stack_level SsizeT, format *c.Char, __llgo_va_list ...any) c.Int

func ErrWriteUnraisable added in v0.2.1

func ErrWriteUnraisable(_llcppg_param1 *Object)

func EvalAcquireThread added in v0.2.1

func EvalAcquireThread(tstate *ThreadState)

func EvalGetFuncDesc added in v0.2.1

func EvalGetFuncDesc(_llcppg_param1 *Object) *c.Char

func EvalGetFuncName added in v0.2.1

func EvalGetFuncName(_llcppg_param1 *Object) *c.Char

func EvalInitThreads added in v0.2.0

func EvalInitThreads()

func EvalMergeCompilerFlags added in v0.2.1

func EvalMergeCompilerFlags(cf *CompilerFlags) c.Int

Look at the current frame's (if any) code's co_flags, and turn on the corresponding compiler flags in cf->cf_flags. Return 1 if any flag was set, else return 0.

func EvalReleaseThread added in v0.2.1

func EvalReleaseThread(tstate *ThreadState)

func EvalRestoreThread added in v0.2.1

func EvalRestoreThread(_llcppg_param1 *ThreadState)

func EvalSetProfile added in v0.2.0

func EvalSetProfile(_llcppg_param1 Tracefunc, _llcppg_param2 *Object)

func EvalSetProfileAllThreads added in v0.2.0

func EvalSetProfileAllThreads(_llcppg_param1 Tracefunc, _llcppg_param2 *Object)

func EvalSetTrace added in v0.2.0

func EvalSetTrace(_llcppg_param1 Tracefunc, _llcppg_param2 *Object)

func EvalSetTraceAllThreads added in v0.2.0

func EvalSetTraceAllThreads(_llcppg_param1 Tracefunc, _llcppg_param2 *Object)

func ExceptionClassName added in v0.2.3

func ExceptionClassName(_llcppg_param1 *Object) *c.Char

func ExceptionSetArgs added in v0.2.3

func ExceptionSetArgs(_llcppg_param1 *Object, _llcppg_param2 *Object)

func ExceptionSetCause added in v0.2.3

func ExceptionSetCause(_llcppg_param1 *Object, _llcppg_param2 *Object)

func ExceptionSetContext added in v0.2.3

func ExceptionSetContext(_llcppg_param1 *Object, _llcppg_param2 *Object)

func ExceptionSetTraceback added in v0.2.3

func ExceptionSetTraceback(_llcppg_param1 *Object, _llcppg_param2 *Object) c.Int

Traceback manipulation (PEP 3134)

func Exit added in v0.2.0

func Exit(_llcppg_param1 c.Int)

func ExitStatusException added in v0.2.0

func ExitStatusException(err Status)

func FatalError added in v0.2.0

func FatalError(message *c.Char)

Defined in Python/pylifecycle.c

The Py_FatalError() function is replaced with a macro which logs automatically the name of the current function, unless the Py_LIMITED_API macro is defined.

func Fclose added in v0.2.0

func Fclose(file *c.FILE) c.Int

func FdIsInteractive added in v0.2.0

func FdIsInteractive(_llcppg_param1 *c.FILE, _llcppg_param2 *c.Char) c.Int

func FileSetOpenCodeHook added in v0.2.0

func FileSetOpenCodeHook(hook OpenCodeHookFunction, userData unsafe.Pointer) c.Int

func FileWriteObject added in v0.2.3

func FileWriteObject(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 c.Int) c.Int

func FileWriteString added in v0.2.0

func FileWriteString(_llcppg_param1 *c.Char, _llcppg_param2 *Object) c.Int

func Finalize added in v0.2.0

func Finalize()

func FinalizeEx added in v0.2.0

func FinalizeEx() c.Int

func FloatGetMax added in v0.2.0

func FloatGetMax() c.Double

func FloatGetMin added in v0.2.0

func FloatGetMin() c.Double

func FloatPack2 added in v0.2.0

func FloatPack2(x c.Double, p *c.Char, le c.Int) c.Int

func FloatPack4 added in v0.2.0

func FloatPack4(x c.Double, p *c.Char, le c.Int) c.Int

func FloatPack8 added in v0.2.0

func FloatPack8(x c.Double, p *c.Char, le c.Int) c.Int

func FloatUnpack2 added in v0.2.0

func FloatUnpack2(p *c.Char, le c.Int) c.Double

func FloatUnpack4 added in v0.2.0

func FloatUnpack4(p *c.Char, le c.Int) c.Double

func FloatUnpack8 added in v0.2.0

func FloatUnpack8(p *c.Char, le c.Int) c.Double

func Fopen added in v0.2.0

func Fopen(path *Object, mode *c.Char) *c.FILE

func FrozenMain added in v0.2.0

func FrozenMain(argc c.Int, argv **c.Char) c.Int

Py_FrozenMain is kept out of the Limited API until documented and present in all builds of Python

func FunctionAddWatcher added in v0.2.0

func FunctionAddWatcher(callback FunctionWatchCallback) c.Int

Register a per-interpreter callback that will be invoked for function lifecycle events.

Returns a handle that may be passed to PyFunction_ClearWatcher on success, or -1 and sets an error if no more handles are available.

func FunctionClearWatcher added in v0.2.0

func FunctionClearWatcher(watcher_id c.Int) c.Int

Clear the watcher associated with the watcher_id handle.

Returns 0 on success or -1 if no watcher exists for the supplied id.

func GC_Disable added in v0.2.0

func GC_Disable() c.Int

func GC_Enable added in v0.2.0

func GC_Enable() c.Int

C API for controlling the state of the garbage collector

func GC_IsEnabled added in v0.2.0

func GC_IsEnabled() c.Int

func GETENV added in v0.2.0

func GETENV(name *c.Char) *c.Char

this is a wrapper around getenv() that pays attention to Py_IgnoreEnvironmentFlag. It should be used for getting variables like PYTHONPATH and PYTHONHOME from the environment

func GILStateCheck added in v0.2.0

func GILStateCheck() c.Int

Helper/diagnostic function - return 1 if the current thread currently holds the GIL, 0 otherwise.

The function returns 1 if _PyGILState_check_enabled is non-zero.

func GILStateRelease added in v0.2.3

func GILStateRelease(_llcppg_param1 GILState_STATE)

Release any resources previously acquired. After this call, Python's state will be the same as it was prior to the corresponding PyGILState_Ensure() call (but generally this state will be unknown to the caller, hence the use of the GILState API.)

Every call to PyGILState_Ensure must be matched by a call to PyGILState_Release on the same thread.

func GetArgcArgv added in v0.2.0

func GetArgcArgv(argc *c.Int, argv ***c.WcharT)

Get the original command line arguments, before Python modified them.

See also PyConfig.orig_argv.

func GetBuildInfo added in v0.2.0

func GetBuildInfo() *c.Char

func GetCompiler added in v0.2.0

func GetCompiler() *c.Char

func GetCopyright added in v0.2.0

func GetCopyright() *c.Char

func GetExecPrefix added in v0.2.0

func GetExecPrefix() *c.WcharT

func GetPath added in v0.2.0

func GetPath() *c.WcharT

func GetPlatform added in v0.2.0

func GetPlatform() *c.Char

func GetPrefix added in v0.2.0

func GetPrefix() *c.WcharT

func GetProgramFullPath added in v0.2.0

func GetProgramFullPath() *c.WcharT

func GetProgramName added in v0.2.0

func GetProgramName() *c.WcharT

func GetPythonHome added in v0.2.0

func GetPythonHome() *c.WcharT

func GetRecursionLimit added in v0.2.0

func GetRecursionLimit() c.Int

func GetVersion added in v0.2.0

func GetVersion() *c.Char

In their own files

func ImportAppendInittab added in v0.2.0

func ImportAppendInittab(name *c.Char, initfunc func() *Object) c.Int

func ImportExtendInittab added in v0.2.0

func ImportExtendInittab(newtab *X_inittab) c.Int

func ImportGetMagicNumber added in v0.2.0

func ImportGetMagicNumber() c.Long

func ImportGetMagicTag added in v0.2.0

func ImportGetMagicTag() *c.Char

func ImportImportFrozenModule added in v0.2.0

func ImportImportFrozenModule(name *c.Char) c.Int

func ImportImportFrozenModuleObject added in v0.2.0

func ImportImportFrozenModuleObject(name *Object) c.Int

func IncRef added in v0.2.0

func IncRef(_llcppg_param1 *Object)

These are provided as conveniences to Python runtime embedders, so that they can have object code that is not dependent on Python compilation flags.

func IndexCheck added in v0.2.3

func IndexCheck(_llcppg_param1 *Object) c.Int

Returns 1 if obj is an index integer (has the nb_index slot of the tp_as_number structure filled in), and 0 otherwise.

func InitConfigAddModule added in v0.2.3

func InitConfigAddModule(config *InitConfig, name *c.Char, initfunc func() *Object) c.Int

func InitConfigFree added in v0.2.3

func InitConfigFree(config *InitConfig)

func InitConfigFreeStrList added in v0.2.0

func InitConfigFreeStrList(length c.SizeT, items **c.Char)

func InitConfigGetError added in v0.2.3

func InitConfigGetError(config *InitConfig, err_msg **c.Char) c.Int

func InitConfigGetExitCode added in v0.2.3

func InitConfigGetExitCode(config *InitConfig, exitcode *c.Int) c.Int

func InitConfigGetInt added in v0.2.3

func InitConfigGetInt(config *InitConfig, name *c.Char, value *c.Int64T) c.Int

func InitConfigGetStr added in v0.2.3

func InitConfigGetStr(config *InitConfig, name *c.Char, value **c.Char) c.Int

func InitConfigGetStrList added in v0.2.3

func InitConfigGetStrList(config *InitConfig, name *c.Char, length *c.SizeT, items ***c.Char) c.Int

func InitConfigHasOption added in v0.2.3

func InitConfigHasOption(config *InitConfig, name *c.Char) c.Int

func InitConfigSetInt added in v0.2.3

func InitConfigSetInt(config *InitConfig, name *c.Char, value c.Int64T) c.Int

func InitConfigSetStr added in v0.2.3

func InitConfigSetStr(config *InitConfig, name *c.Char, value *c.Char) c.Int

func InitConfigSetStrList added in v0.2.3

func InitConfigSetStrList(config *InitConfig, name *c.Char, length c.SizeT, items **c.Char) c.Int

func Initialize added in v0.2.0

func Initialize()

Initialization and finalization

func InitializeEx added in v0.2.0

func InitializeEx(_llcppg_param1 c.Int)

func InitializeFromInitConfig added in v0.2.0

func InitializeFromInitConfig(config *InitConfig) c.Int

func InterpreterStateClear added in v0.2.3

func InterpreterStateClear(_llcppg_param1 *InterpreterState)

func InterpreterStateDelete added in v0.2.3

func InterpreterStateDelete(_llcppg_param1 *InterpreterState)

func InterpreterState_GetID added in v0.2.3

func InterpreterState_GetID(_llcppg_param1 *InterpreterState) c.Int64T

New in 3.7

func Is added in v0.2.0

func Is(x *Object, y *Object) c.Int

Test if the 'x' object is the 'y' object, the same as "x is y" in Python.

func IsFalse added in v0.2.0

func IsFalse(x *Object) c.Int

Test if an object is the False singleton, the same as "x is False" in Python.

func IsFinalizing added in v0.2.0

func IsFinalizing() c.Int

func IsInitialized added in v0.2.0

func IsInitialized() c.Int

func IsNone added in v0.2.0

func IsNone(x *Object) c.Int

Test if an object is the None singleton, the same as "x is None" in Python.

func IsTrue added in v0.2.0

func IsTrue(x *Object) c.Int

Test if an object is the True singleton, the same as "x is True" in Python.

func IterCheck added in v0.2.3

func IterCheck(_llcppg_param1 *Object) c.Int

Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise.

This function always succeeds.

func IterNextItem added in v0.2.3

func IterNextItem(iter *Object, item **Object) c.Int

Return 1 and set 'item' to the next item of 'iter' on success. Return 0 and set 'item' to NULL when there are no remaining values. Return -1, set 'item' to NULL and set an exception on error.

func LeaveRecursiveCall added in v0.2.0

func LeaveRecursiveCall()

func LongWriterDiscard added in v0.2.3

func LongWriterDiscard(writer *LongWriter)

func Main added in v0.2.0

func Main(argc c.Int, argv **c.WcharT) c.Int

Bootstrap __main__ (defined in Modules/main.c)

func MakePendingCalls added in v0.2.0

func MakePendingCalls() c.Int

func MappingCheck added in v0.2.3

func MappingCheck(o *Object) c.Int

Return 1 if the object provides mapping protocol, and 0 otherwise.

This function always succeeds.

func MappingGetOptionalItem added in v0.2.3

func MappingGetOptionalItem(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 **Object) c.Int

func MappingGetOptionalItemString added in v0.2.3

func MappingGetOptionalItemString(_llcppg_param1 *Object, _llcppg_param2 *c.Char, _llcppg_param3 **Object) c.Int

func MappingHasKey added in v0.2.3

func MappingHasKey(o *Object, key *Object) c.Int

Return 1 if the mapping object has the key 'key', and 0 otherwise.

This is equivalent to the Python expression: key in o.

This function always succeeds.

func MappingHasKeyString added in v0.2.3

func MappingHasKeyString(o *Object, key *c.Char) c.Int

On success, return 1 if the mapping object 'o' has the key 'key', and 0 otherwise.

This is equivalent to the Python expression: key in o.

This function always succeeds.

func MappingHasKeyStringWithError added in v0.2.3

func MappingHasKeyStringWithError(o *Object, key *c.Char) c.Int

Return 1 if the mapping object has the key 'key', and 0 otherwise. This is equivalent to the Python expression: key in o. On failure, return -1.

func MappingHasKeyWithError added in v0.2.3

func MappingHasKeyWithError(o *Object, key *Object) c.Int

Return 1 if the mapping object has the key 'key', and 0 otherwise. This is equivalent to the Python expression: key in o. On failure, return -1.

func MappingSetItemString added in v0.2.3

func MappingSetItemString(o *Object, key *c.Char, value *Object) c.Int

Map the string 'key' to the value 'v' in the mapping 'o'. Returns -1 on failure.

This is the equivalent of the Python statement: o[key]=v.

func MemCalloc added in v0.2.0

func MemCalloc(nelem c.SizeT, elsize c.SizeT) unsafe.Pointer

func MemFree added in v0.2.0

func MemFree(ptr unsafe.Pointer)

func MemGetAllocator added in v0.2.3

func MemGetAllocator(domain MemAllocatorDomain, allocator *MemAllocatorEx)

Get the memory block allocator of the specified domain.

func MemMalloc added in v0.2.0

func MemMalloc(size c.SizeT) unsafe.Pointer

Functions

Functions supplying platform-independent semantics for malloc/realloc/ free. These functions make sure that allocating 0 bytes returns a distinct non-NULL pointer (whenever possible -- if we're flat out of memory, NULL may be returned), even if the platform malloc and realloc don't. Returned pointers must be checked for NULL explicitly. No action is performed on failure (no exception is set, no warning is printed, etc).

func MemRawCalloc added in v0.2.0

func MemRawCalloc(nelem c.SizeT, elsize c.SizeT) unsafe.Pointer

func MemRawFree added in v0.2.0

func MemRawFree(ptr unsafe.Pointer)

func MemRawMalloc added in v0.2.0

func MemRawMalloc(size c.SizeT) unsafe.Pointer

Memory allocator which doesn't require the GIL to be held. Usually, it's just a thin wrapper to functions of the standard C library: malloc(), calloc(), realloc() and free(). The difference is that tracemalloc can track these memory allocations.

func MemRawRealloc added in v0.2.0

func MemRawRealloc(ptr unsafe.Pointer, new_size c.SizeT) unsafe.Pointer

func MemRealloc added in v0.2.0

func MemRealloc(ptr unsafe.Pointer, new_size c.SizeT) unsafe.Pointer

func MemSetAllocator added in v0.2.3

func MemSetAllocator(domain MemAllocatorDomain, allocator *MemAllocatorEx)

Set the memory block allocator of the specified domain.

The new allocator must return a distinct non-NULL pointer when requesting zero bytes.

For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL is not held when the allocator is called.

If the new allocator is not a hook (don't call the previous allocator), the PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks on top on the new allocator.

func MemSetupDebugHooks added in v0.2.0

func MemSetupDebugHooks()

Setup hooks to detect bugs in the following Python memory allocator functions:

- PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free() - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()

Newly allocated memory is filled with the byte 0xCB, freed memory is filled with the byte 0xDB. Additional checks:

- detect API violations, ex: PyObject_Free() called on a buffer allocated by PyMem_Malloc() - detect write before the start of the buffer (buffer underflow) - detect write after the end of the buffer (buffer overflow)

The function does nothing if Python is not compiled is debug mode.

func MemberSetOne added in v0.2.0

func MemberSetOne(_llcppg_param1 *c.Char, _llcppg_param2 *MemberDef, _llcppg_param3 *Object) c.Int

func ModuleAdd added in v0.2.3

func ModuleAdd(mod *Object, name *c.Char, value *Object) c.Int

Similar to PyModule_AddObjectRef() but steal a reference to 'value'.

func ModuleAddFunctions added in v0.2.3

func ModuleAddFunctions(_llcppg_param1 *Object, _llcppg_param2 *MethodDef) c.Int

func ModuleAddIntConstant added in v0.2.3

func ModuleAddIntConstant(_llcppg_param1 *Object, _llcppg_param2 *c.Char, _llcppg_param3 c.Long) c.Int

func ModuleAddObject added in v0.2.3

func ModuleAddObject(mod *Object, _llcppg_param2 *c.Char, value *Object) c.Int

Similar to PyModule_AddObjectRef() and PyModule_Add() but steal a reference to 'value' on success and only on success. Errorprone. Should not be used in new code.

func ModuleAddObjectRef added in v0.2.3

func ModuleAddObjectRef(mod *Object, name *c.Char, value *Object) c.Int

Add an attribute with name 'name' and value 'obj' to the module 'mod. On success, return 0. On error, raise an exception and return -1.

func ModuleAddStringConstant added in v0.2.3

func ModuleAddStringConstant(_llcppg_param1 *Object, _llcppg_param2 *c.Char, _llcppg_param3 *c.Char) c.Int

func ModuleAddType added in v0.2.3

func ModuleAddType(module *Object, type_ *TypeObject) c.Int

New in 3.9

func ModuleExecDef added in v0.2.3

func ModuleExecDef(module *Object, def *ModuleDef) c.Int

func ModuleGetFilename added in v0.2.3

func ModuleGetFilename(_llcppg_param1 *Object) *c.Char

func ModuleGetName added in v0.2.3

func ModuleGetName(_llcppg_param1 *Object) *c.Char

func ModuleGetState added in v0.2.3

func ModuleGetState(_llcppg_param1 *Object) unsafe.Pointer

func ModuleSetDocString added in v0.2.3

func ModuleSetDocString(_llcppg_param1 *Object, _llcppg_param2 *c.Char) c.Int

New in 3.5

func MonitoringEnterScope added in v0.2.3

func MonitoringEnterScope(state_array *MonitoringState, version *c.Uint64T, event_types *c.Uint8T, length SsizeT) c.Int

func MonitoringExitScope added in v0.2.0

func MonitoringExitScope() c.Int

func MutexIsLocked added in v0.2.3

func MutexIsLocked(m *Mutex) c.Int

exported function for checking if the mutex is locked

func MutexLock added in v0.2.3

func MutexLock(m *Mutex)

exported function for locking the mutex

func MutexUnlock added in v0.2.3

func MutexUnlock(m *Mutex)

exported function for unlocking the mutex

func NumberCheck added in v0.2.3

func NumberCheck(o *Object) c.Int

Returns 1 if the object 'o' provides numeric protocols, and 0 otherwise.

This function always succeeds.

func OSDoubleToString added in v0.2.0

func OSDoubleToString(val c.Double, format_code c.Char, precision c.Int, flags c.Int, type_ *c.Int) *c.Char

The caller is responsible for calling PyMem_Free to free the buffer that's is returned.

func OSMystricmp added in v0.2.0

func OSMystricmp(_llcppg_param1 *c.Char, _llcppg_param2 *c.Char) c.Int

func OSMystrnicmp added in v0.2.0

func OSMystrnicmp(_llcppg_param1 *c.Char, _llcppg_param2 *c.Char, _llcppg_param3 SsizeT) c.Int

func OSSnprintf added in v0.2.0

func OSSnprintf(str *c.Char, size c.SizeT, format *c.Char, __llgo_va_list ...any) c.Int

func OSStringToDouble added in v0.2.0

func OSStringToDouble(str *c.Char, endptr **c.Char, overflow_exception *Object) c.Double

func OSStrtol added in v0.2.0

func OSStrtol(_llcppg_param1 *c.Char, _llcppg_param2 **c.Char, _llcppg_param3 c.Int) c.Long

func OSStrtoul added in v0.2.0

func OSStrtoul(_llcppg_param1 *c.Char, _llcppg_param2 **c.Char, _llcppg_param3 c.Int) c.Ulong

These aren't really part of the int object, but they're handy. The functions are in Python/mystrtoul.c.

func OSVsnprintf added in v0.2.0

func OSVsnprintf(str *c.Char, size c.SizeT, format *c.Char, va c.VaList) c.Int

func OS_AfterFork added in v0.2.0

func OS_AfterFork()

Deprecated, please use PyOS_AfterFork_Child() instead

func OS_AfterFork_Child added in v0.2.0

func OS_AfterFork_Child()

func OS_AfterFork_Parent added in v0.2.0

func OS_AfterFork_Parent()

func OS_BeforeFork added in v0.2.0

func OS_BeforeFork()

func OS_InterruptOccurred added in v0.2.0

func OS_InterruptOccurred() c.Int

func OS_Readline added in v0.2.0

func OS_Readline(_llcppg_param1 *c.FILE, _llcppg_param2 *c.FILE, _llcppg_param3 *c.Char) *c.Char

Stuff with no proper home (yet)

func ObjectCalloc added in v0.2.0

func ObjectCalloc(nelem c.SizeT, elsize c.SizeT) unsafe.Pointer

func ObjectFree added in v0.2.0

func ObjectFree(ptr unsafe.Pointer)

func ObjectMalloc added in v0.2.0

func ObjectMalloc(size c.SizeT) unsafe.Pointer

Functions to call the same malloc/realloc/free as used by Python's object allocator. If WITH_PYMALLOC is enabled, these may differ from the platform malloc/realloc/free. The Python object allocator is designed for fast, cache-conscious allocation of many "small" objects, and with low hidden memory overhead.

PyObject_Malloc(0) returns a unique non-NULL pointer if possible.

PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n). PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory at p.

Returned pointers must be checked for NULL explicitly; no action is performed on failure other than to return NULL (no warning it printed, no exception is set, etc).

For allocating objects, use PyObject_{New, NewVar} instead whenever possible. The PyObject_{Malloc, Realloc, Free} family is exposed so that you can exploit Python's small-block allocator for non-object uses. If you must use these routines to allocate object memory, make sure the object gets initialized via PyObject_{Init, InitVar} after obtaining the raw memory.

func ObjectRealloc added in v0.2.0

func ObjectRealloc(ptr unsafe.Pointer, new_size c.SizeT) unsafe.Pointer

func Object_GC_Del added in v0.2.0

func Object_GC_Del(_llcppg_param1 unsafe.Pointer)

func Object_GC_Track added in v0.2.0

func Object_GC_Track(_llcppg_param1 unsafe.Pointer)

Tell the GC to track this object.

See also private _PyObject_GC_TRACK() macro.

func Object_GC_UnTrack added in v0.2.0

func Object_GC_UnTrack(_llcppg_param1 unsafe.Pointer)

Tell the GC to stop tracking this object.

See also private _PyObject_GC_UNTRACK() macro.

func PACK_FULL_VERSION added in v0.2.0

func PACK_FULL_VERSION(x c.Int, y c.Int, z c.Int, level c.Int, serial c.Int) c.Uint32T

Version helpers. These are primarily macros, but have exported equivalents.

func PACK_VERSION added in v0.2.0

func PACK_VERSION(x c.Int, y c.Int) c.Uint32T

func PickleBufferRelease added in v0.2.3

func PickleBufferRelease(_llcppg_param1 *Object) c.Int

Release the PickleBuffer. Returns 0 on success, -1 on error.

func PreConfigInitIsolatedConfig added in v0.2.3

func PreConfigInitIsolatedConfig(config *PreConfig)

func PreConfigInitPythonConfig added in v0.2.3

func PreConfigInitPythonConfig(config *PreConfig)

func RefTracerSetTracer added in v0.2.0

func RefTracerSetTracer(tracer RefTracer, data unsafe.Pointer) c.Int

func ReprEnter added in v0.2.0

func ReprEnter(_llcppg_param1 *Object) c.Int

Helpers for printing recursive container types

func ReprLeave added in v0.2.0

func ReprLeave(_llcppg_param1 *Object)

func RunAnyFile added in v0.2.0

func RunAnyFile(fp *c.FILE, name *c.Char) c.Int

func RunAnyFileEx added in v0.2.0

func RunAnyFileEx(fp *c.FILE, name *c.Char, closeit c.Int) c.Int

func RunAnyFileExFlags added in v0.2.0

func RunAnyFileExFlags(fp *c.FILE, filename *c.Char, closeit c.Int, flags *CompilerFlags) c.Int

func RunAnyFileFlags added in v0.2.0

func RunAnyFileFlags(_llcppg_param1 *c.FILE, _llcppg_param2 *c.Char, _llcppg_param3 *CompilerFlags) c.Int

func RunInteractiveLoop added in v0.2.0

func RunInteractiveLoop(f *c.FILE, p *c.Char) c.Int

func RunInteractiveLoopFlags added in v0.2.0

func RunInteractiveLoopFlags(fp *c.FILE, filename *c.Char, flags *CompilerFlags) c.Int

func RunInteractiveOne added in v0.2.0

func RunInteractiveOne(f *c.FILE, p *c.Char) c.Int

func RunInteractiveOneFlags added in v0.2.0

func RunInteractiveOneFlags(fp *c.FILE, filename *c.Char, flags *CompilerFlags) c.Int

func RunInteractiveOneObject added in v0.2.0

func RunInteractiveOneObject(fp *c.FILE, filename *Object, flags *CompilerFlags) c.Int

func RunMain added in v0.2.0

func RunMain() c.Int

func RunSimpleFile added in v0.2.0

func RunSimpleFile(f *c.FILE, p *c.Char) c.Int

func RunSimpleFileEx added in v0.2.0

func RunSimpleFileEx(f *c.FILE, p *c.Char, c c.Int) c.Int

func RunSimpleFileExFlags added in v0.2.0

func RunSimpleFileExFlags(fp *c.FILE, filename *c.Char, closeit c.Int, flags *CompilerFlags) c.Int

func RunSimpleString added in v0.2.0

func RunSimpleString(s *c.Char) c.Int

func RunSimpleStringFlags added in v0.2.0

func RunSimpleStringFlags(_llcppg_param1 *c.Char, _llcppg_param2 *CompilerFlags) c.Int

func SequenceCheck added in v0.2.3

func SequenceCheck(o *Object) c.Int

Return 1 if the object provides sequence protocol, and zero otherwise.

This function always succeeds.

func SequenceContains added in v0.2.3

func SequenceContains(seq *Object, ob *Object) c.Int

Return 1 if 'ob' is in the sequence 'seq'; 0 if 'ob' is not in the sequence 'seq'; -1 on error.

Use __contains__ if possible, else _PySequence_IterSearch().

func SequenceDelItem added in v0.2.3

func SequenceDelItem(o *Object, i SsizeT) c.Int

Delete the 'i'-th element of the sequence 'v'. Returns -1 on failure.

This is the equivalent of the Python statement: del o[i].

func SequenceDelSlice added in v0.2.3

func SequenceDelSlice(o *Object, i1 SsizeT, i2 SsizeT) c.Int

Delete the slice in sequence object 'o' from 'i1' to 'i2'. Returns -1 on failure.

This is the equivalent of the Python statement: del o[i1:i2].

func SequenceIn added in v0.2.3

func SequenceIn(o *Object, value *Object) c.Int

Determine if the sequence 'o' contains 'value'. If an item in 'o' is equal to 'value', return 1, otherwise return 0. On error, return -1.

This is equivalent to the Python expression: value in o.

func SequenceSetItem added in v0.2.3

func SequenceSetItem(o *Object, i SsizeT, v *Object) c.Int

Assign object 'v' to the ith element of the sequence 'o'. Raise an exception and return -1 on failure; return 0 on success.

This is the equivalent of the Python statement o[i] = v.

func SequenceSetSlice added in v0.2.3

func SequenceSetSlice(o *Object, i1 SsizeT, i2 SsizeT, v *Object) c.Int

Assign the sequence object 'v' to the slice in sequence object 'o', from 'i1' to 'i2'. Returns -1 on failure.

This is the equivalent of the Python statement: o[i1:i2] = v.

func SetProgramName added in v0.2.0

func SetProgramName(_llcppg_param1 *c.WcharT)

In pathconfig.c

func SetPythonHome added in v0.2.0

func SetPythonHome(_llcppg_param1 *c.WcharT)

func SetRecursionLimit added in v0.2.0

func SetRecursionLimit(_llcppg_param1 c.Int)

Protection against deeply nested recursive calls

In Python 3.0, this protection has two levels: normal anti-recursion protection is triggered when the recursion level exceeds the current recursion limit. It raises a RecursionError, and sets the "overflowed" flag in the thread state structure. This flag temporarily *disables* the normal protection; this allows cleanup code to potentially outgrow the recursion limit while processing the RecursionError. "last chance" anti-recursion protection is triggered when the recursion level exceeds "current recursion limit + 50". By construction, this protection can only be triggered when the "overflowed" flag is set. It means the cleanup code has itself gone into an infinite loop, or the RecursionError has been mistakenly ignored. When this protection is triggered, the interpreter aborts with a Fatal Error.

In addition, the "overflowed" flag is automatically reset when the recursion level drops below "current recursion limit - 50". This heuristic is meant to ensure that the normal anti-recursion protection doesn't get disabled too long.

Please note: this scheme has its own limitations. See: http://mail.python.org/pipermail/python-dev/2008-August/082106.html for some observations.

func SignalSetWakeupFd added in v0.2.0

func SignalSetWakeupFd(fd c.Int) c.Int

In signalmodule.c

func StateAddModule added in v0.2.3

func StateAddModule(_llcppg_param1 *Object, _llcppg_param2 *ModuleDef) c.Int

New in 3.3

func StateRemoveModule added in v0.2.3

func StateRemoveModule(_llcppg_param1 *ModuleDef) c.Int

func StatusException added in v0.2.3

func StatusException(err Status) c.Int

func StatusIsError added in v0.2.3

func StatusIsError(err Status) c.Int

func StatusIsExit added in v0.2.3

func StatusIsExit(err Status) c.Int

func StructSequenceInitType added in v0.2.3

func StructSequenceInitType(type_ *TypeObject, desc *StructSequenceDesc)

func StructSequenceInitType2 added in v0.2.3

func StructSequenceInitType2(type_ *TypeObject, desc *StructSequenceDesc) c.Int

func StructSequenceSetItem added in v0.2.3

func StructSequenceSetItem(_llcppg_param1 *Object, _llcppg_param2 SsizeT, _llcppg_param3 *Object)

func SysAddAuditHook added in v0.2.0

func SysAddAuditHook(_llcppg_param1 AuditHookFunction, _llcppg_param2 unsafe.Pointer) c.Int

func SysAudit added in v0.2.0

func SysAudit(event *c.Char, argFormat *c.Char, __llgo_va_list ...any) c.Int

func SysAuditTuple added in v0.2.0

func SysAuditTuple(event *c.Char, args *Object) c.Int

func SysFormatStderr added in v0.2.0

func SysFormatStderr(format *c.Char, __llgo_va_list ...any)

func SysFormatStdout added in v0.2.0

func SysFormatStdout(format *c.Char, __llgo_va_list ...any)

func SysResetWarnOptions added in v0.2.0

func SysResetWarnOptions()

func SysSetArgv added in v0.2.0

func SysSetArgv(_llcppg_param1 c.Int, _llcppg_param2 **c.WcharT)

func SysSetArgvEx added in v0.2.0

func SysSetArgvEx(_llcppg_param1 c.Int, _llcppg_param2 **c.WcharT, _llcppg_param3 c.Int)

func SysSetObject added in v0.2.0

func SysSetObject(_llcppg_param1 *c.Char, _llcppg_param2 *Object) c.Int

func SysWriteStderr added in v0.2.0

func SysWriteStderr(format *c.Char, __llgo_va_list ...any)

func SysWriteStdout added in v0.2.0

func SysWriteStdout(format *c.Char, __llgo_va_list ...any)

func ThreadAcquireLock added in v0.2.3

func ThreadAcquireLock(_llcppg_param1 ThreadTypeLock, _llcppg_param2 c.Int) c.Int

func ThreadCreateKey added in v0.2.0

func ThreadCreateKey() c.Int

Thread Local Storage (TLS) API TLS API is DEPRECATED. Use Thread Specific Storage (TSS) API.

The existing TLS API has used int to represent TLS keys across all platforms, but it is not POSIX-compliant. Therefore, the new TSS API uses opaque data type to represent TSS keys to be compatible (see PEP 539).

func ThreadDeleteKey added in v0.2.0

func ThreadDeleteKey(key c.Int)

func ThreadDeleteKeyValue added in v0.2.0

func ThreadDeleteKeyValue(key c.Int)

func ThreadExitThread added in v0.2.0

func ThreadExitThread()

Terminates the current thread. Considered unsafe.

WARNING: This function is only safe to call if all functions in the full call stack are written to safely allow it. Additionally, the behavior is platform-dependent. This function should be avoided, and is no longer called by Python itself. It is retained only for compatibility with existing C extension code.

With pthreads, calls `pthread_exit` causes some libcs (glibc?) to attempt to unwind the stack and call C++ destructors; if a `noexcept` function is reached, they may terminate the process. Others (macOS) do unwinding.

On Windows, calls `_endthreadex` which kills the thread without calling C++ destructors.

In either case there is a risk of invalid references remaining to data on the thread stack.

func ThreadFreeLock added in v0.2.3

func ThreadFreeLock(_llcppg_param1 ThreadTypeLock)

func ThreadGetKeyValue added in v0.2.0

func ThreadGetKeyValue(key c.Int) unsafe.Pointer

func ThreadGetStacksize added in v0.2.0

func ThreadGetStacksize() c.SizeT

func ThreadGetThreadIdent added in v0.2.0

func ThreadGetThreadIdent() c.Ulong

func ThreadGetThreadNativeId added in v0.2.0

func ThreadGetThreadNativeId() c.Ulong

func ThreadInitThread added in v0.2.0

func ThreadInitThread()

func ThreadReleaseLock added in v0.2.3

func ThreadReleaseLock(_llcppg_param1 ThreadTypeLock)

func ThreadSetKeyValue added in v0.2.0

func ThreadSetKeyValue(key c.Int, value unsafe.Pointer) c.Int

func ThreadSetStacksize added in v0.2.0

func ThreadSetStacksize(_llcppg_param1 c.SizeT) c.Int

func ThreadStartNewThread added in v0.2.0

func ThreadStartNewThread(_llcppg_param1 func(_llcppg_param1 unsafe.Pointer), _llcppg_param2 unsafe.Pointer) c.Ulong

func ThreadStateClear added in v0.2.3

func ThreadStateClear(_llcppg_param1 *ThreadState)

func ThreadStateDelete added in v0.2.3

func ThreadStateDelete(_llcppg_param1 *ThreadState)

func ThreadStateDeleteCurrent added in v0.2.0

func ThreadStateDeleteCurrent()

func ThreadStateEnterTracing added in v0.2.3

func ThreadStateEnterTracing(tstate *ThreadState)

Disable tracing and profiling.

func ThreadStateLeaveTracing added in v0.2.3

func ThreadStateLeaveTracing(tstate *ThreadState)

Reset tracing and profiling: enable them if a trace function or a profile function is set, otherwise disable them.

func ThreadStateSetAsyncExc added in v0.2.0

func ThreadStateSetAsyncExc(_llcppg_param1 c.Ulong, _llcppg_param2 *Object) c.Int

func ThreadState_GetID added in v0.2.3

func ThreadState_GetID(tstate *ThreadState) c.Uint64T

func ThreadTssCreate added in v0.2.3

func ThreadTssCreate(key *TssT) c.Int

func ThreadTssDelete added in v0.2.3

func ThreadTssDelete(key *TssT)

func ThreadTssFree added in v0.2.3

func ThreadTssFree(key *TssT)

func ThreadTssGet added in v0.2.3

func ThreadTssGet(key *TssT) unsafe.Pointer

func ThreadTssIsCreated added in v0.2.3

func ThreadTssIsCreated(key *TssT) c.Int

The parameter key must not be NULL.

func ThreadTssSet added in v0.2.3

func ThreadTssSet(key *TssT, value unsafe.Pointer) c.Int

func Thread_ReInitTLS added in v0.2.0

func Thread_ReInitTLS()

Cleanup after a fork

func TimeAsSecondsDouble added in v0.2.0

func TimeAsSecondsDouble(t TimeT) c.Double

func TimeMonotonic added in v0.2.0

func TimeMonotonic(result *TimeT) c.Int

func TimeMonotonicRaw added in v0.2.0

func TimeMonotonicRaw(result *TimeT) c.Int

func TimePerfCounter added in v0.2.0

func TimePerfCounter(result *TimeT) c.Int

func TimePerfCounterRaw added in v0.2.0

func TimePerfCounterRaw(result *TimeT) c.Int

func TimeTime added in v0.2.0

func TimeTime(result *TimeT) c.Int

func TimeTimeRaw added in v0.2.0

func TimeTimeRaw(result *TimeT) c.Int

func TraceBackHere added in v0.2.3

func TraceBackHere(_llcppg_param1 *FrameObject) c.Int

Traceback interface

func TraceBackPrint added in v0.2.3

func TraceBackPrint(_llcppg_param1 *Object, _llcppg_param2 *Object) c.Int

func TraceMallocTrack added in v0.2.0

func TraceMallocTrack(domain c.Uint, ptr c.UintptrT, size c.SizeT) c.Int

Track an allocated memory block in the tracemalloc module. Return 0 on success, return -1 on error (failed to allocate memory to store the trace).

Return -2 if tracemalloc is disabled.

If memory block is already tracked, update the existing trace.

func TraceMallocUntrack added in v0.2.0

func TraceMallocUntrack(domain c.Uint, ptr c.UintptrT) c.Int

Untrack an allocated memory block in the tracemalloc module. Do nothing if the block was not tracked.

Return -2 if tracemalloc is disabled, otherwise return 0.

func TypeAddWatcher added in v0.2.0

func TypeAddWatcher(callback TypeWatchCallback) c.Int

func TypeClearCache added in v0.2.0

func TypeClearCache() c.Uint

func TypeClearWatcher added in v0.2.0

func TypeClearWatcher(watcher_id c.Int) c.Int

func TypeUnwatch added in v0.2.0

func TypeUnwatch(watcher_id c.Int, type_ *Object) c.Int

func TypeWatch added in v0.2.0

func TypeWatch(watcher_id c.Int, type_ *Object) c.Int

func UnicodeAppend added in v0.2.0

func UnicodeAppend(pleft **Object, right *Object)

Concat two strings and put the result in *pleft (sets *pleft to NULL on error)

func UnicodeAppendAndDel added in v0.2.0

func UnicodeAppendAndDel(pleft **Object, right *Object)

Concat two strings, put the result in *pleft and drop the right object (sets *pleft to NULL on error)

func UnicodeDecodeErrorGetEnd added in v0.2.3

func UnicodeDecodeErrorGetEnd(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

func UnicodeDecodeErrorGetStart added in v0.2.3

func UnicodeDecodeErrorGetStart(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

func UnicodeDecodeErrorSetEnd added in v0.2.3

func UnicodeDecodeErrorSetEnd(_llcppg_param1 *Object, _llcppg_param2 SsizeT) c.Int

func UnicodeDecodeErrorSetReason added in v0.2.3

func UnicodeDecodeErrorSetReason(exc *Object, reason *c.Char) c.Int

func UnicodeDecodeErrorSetStart added in v0.2.3

func UnicodeDecodeErrorSetStart(_llcppg_param1 *Object, _llcppg_param2 SsizeT) c.Int

func UnicodeEncodeErrorGetEnd added in v0.2.3

func UnicodeEncodeErrorGetEnd(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

get the value of the end attribute (the int *may not be NULL) return 0 on success, -1 on failure

func UnicodeEncodeErrorGetStart added in v0.2.3

func UnicodeEncodeErrorGetStart(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

get the value of the start attribute (the int * may not be NULL) return 0 on success, -1 on failure

func UnicodeEncodeErrorSetEnd added in v0.2.3

func UnicodeEncodeErrorSetEnd(_llcppg_param1 *Object, _llcppg_param2 SsizeT) c.Int

assign a new value to the end attribute return 0 on success, -1 on failure

func UnicodeEncodeErrorSetReason added in v0.2.3

func UnicodeEncodeErrorSetReason(exc *Object, reason *c.Char) c.Int

assign a new value to the reason attribute return 0 on success, -1 on failure

func UnicodeEncodeErrorSetStart added in v0.2.3

func UnicodeEncodeErrorSetStart(_llcppg_param1 *Object, _llcppg_param2 SsizeT) c.Int

assign a new value to the start attribute return 0 on success, -1 on failure

func UnicodeGetDefaultEncoding added in v0.2.0

func UnicodeGetDefaultEncoding() *c.Char

Returns "utf-8".

func UnicodeInternInPlace added in v0.2.0

func UnicodeInternInPlace(_llcppg_param1 **Object)

func UnicodeResize added in v0.2.0

func UnicodeResize(unicode **Object, length SsizeT) c.Int

Resize a Unicode object. The length is the number of codepoints.

unicode is modified to point to the new (resized) object and 0 returned on success.

Try to resize the string in place (which is usually faster than allocating a new string and copy characters), or create a new string.

Error handling is implemented as follows: an exception is set, -1 is returned and *unicode left untouched.

WARNING: The function doesn't check string content, the result may not be a string in canonical representation.

func UnicodeTranslateErrorGetEnd added in v0.2.3

func UnicodeTranslateErrorGetEnd(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

func UnicodeTranslateErrorGetStart added in v0.2.3

func UnicodeTranslateErrorGetStart(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

func UnicodeTranslateErrorSetEnd added in v0.2.3

func UnicodeTranslateErrorSetEnd(_llcppg_param1 *Object, _llcppg_param2 SsizeT) c.Int

func UnicodeTranslateErrorSetReason added in v0.2.3

func UnicodeTranslateErrorSetReason(exc *Object, reason *c.Char) c.Int

func UnicodeTranslateErrorSetStart added in v0.2.3

func UnicodeTranslateErrorSetStart(_llcppg_param1 *Object, _llcppg_param2 SsizeT) c.Int

func UnicodeWriterDecodeUTF8Stateful added in v0.2.3

func UnicodeWriterDecodeUTF8Stateful(writer *UnicodeWriter, string *c.Char, length SsizeT, errors *c.Char, consumed *SsizeT) c.Int

func UnicodeWriterDiscard added in v0.2.3

func UnicodeWriterDiscard(writer *UnicodeWriter)

func UnicodeWriterFormat added in v0.2.3

func UnicodeWriterFormat(writer *UnicodeWriter, format *c.Char, __llgo_va_list ...any) c.Int

func UnicodeWriterWriteChar added in v0.2.3

func UnicodeWriterWriteChar(writer *UnicodeWriter, ch UCS4) c.Int

func UnicodeWriterWriteRepr added in v0.2.3

func UnicodeWriterWriteRepr(writer *UnicodeWriter, obj *Object) c.Int

func UnicodeWriterWriteStr added in v0.2.3

func UnicodeWriterWriteStr(writer *UnicodeWriter, obj *Object) c.Int

func UnicodeWriterWriteSubstring added in v0.2.3

func UnicodeWriterWriteSubstring(writer *UnicodeWriter, str *Object, start SsizeT, end SsizeT) c.Int

func UnicodeWriterWriteUCS4 added in v0.2.3

func UnicodeWriterWriteUCS4(writer *UnicodeWriter, str *UCS4, size SsizeT) c.Int

func UnicodeWriterWriteUTF8 added in v0.2.3

func UnicodeWriterWriteUTF8(writer *UnicodeWriter, str *c.Char, size SsizeT) c.Int

func UnicodeWriterWriteWideChar added in v0.2.3

func UnicodeWriterWriteWideChar(writer *UnicodeWriter, str *c.WcharT, size SsizeT) c.Int

func UnicodeWriter_WriteASCII added in v0.2.3

func UnicodeWriter_WriteASCII(writer *UnicodeWriter, str *c.Char, size SsizeT) c.Int

func UniversalNewlineFgets added in v0.2.0

func UniversalNewlineFgets(_llcppg_param1 *c.Char, _llcppg_param2 c.Int, _llcppg_param3 *c.FILE, _llcppg_param4 *Object) *c.Char

func UnstableAtExit added in v0.2.3

func UnstableAtExit(_llcppg_param1 *InterpreterState, _llcppg_param2 AtexitDatacallbackfunc, _llcppg_param3 unsafe.Pointer) c.Int

func UnstableCodeGetExtra added in v0.2.3

func UnstableCodeGetExtra(code *Object, index SsizeT, extra *unsafe.Pointer) c.Int

func UnstableCodeSetExtra added in v0.2.3

func UnstableCodeSetExtra(code *Object, index SsizeT, extra unsafe.Pointer) c.Int

func UnstableCopyPerfMapFile added in v0.2.0

func UnstableCopyPerfMapFile(parent_filename *c.Char) c.Int

func UnstableEnableTryIncRef added in v0.2.3

func UnstableEnableTryIncRef(_llcppg_param1 *Object)

func UnstableInterpreterFrameGetLasti added in v0.2.3

func UnstableInterpreterFrameGetLasti(frame *X_InterpreterFrame) c.Int

Returns a byte offset into the last executed instruction. Does not raise an exception.

func UnstableInterpreterFrameGetLine added in v0.2.3

func UnstableInterpreterFrameGetLine(frame *X_InterpreterFrame) c.Int

Returns the currently executing line number, or -1 if there is no line number. Does not raise an exception.

func UnstableIsImmortal added in v0.2.3

func UnstableIsImmortal(_llcppg_param1 *Object) c.Int

Check whether the object is immortal. This cannot fail.

func UnstableLongIsCompact added in v0.2.3

func UnstableLongIsCompact(op *LongObject) c.Int

func UnstableObjectClearWeakRefsNoCallbacks added in v0.2.3

func UnstableObjectClearWeakRefsNoCallbacks(_llcppg_param1 *Object)

func UnstableObjectEnableDeferredRefcount added in v0.2.3

func UnstableObjectEnableDeferredRefcount(_llcppg_param1 *Object) c.Int

Enable PEP-703 deferred reference counting on the object.

Returns 1 if deferred reference counting was successfully enabled, and 0 if the runtime ignored it. This function cannot fail.

func UnstableObjectIsUniqueReferencedTemporary added in v0.2.3

func UnstableObjectIsUniqueReferencedTemporary(_llcppg_param1 *Object) c.Int

Determine if the object exists as a unique temporary variable on the topmost frame of the interpreter.

func UnstableObjectIsUniquelyReferenced added in v0.2.3

func UnstableObjectIsUniquelyReferenced(_llcppg_param1 *Object) c.Int

func UnstablePerfMapStateFini added in v0.2.0

func UnstablePerfMapStateFini()

func UnstablePerfMapStateInit added in v0.2.0

func UnstablePerfMapStateInit() c.Int

func UnstablePerfTrampolineCompileCode added in v0.2.3

func UnstablePerfTrampolineCompileCode(_llcppg_param1 *CodeObject) c.Int

func UnstablePerfTrampolineSetPersistAfterFork added in v0.2.0

func UnstablePerfTrampolineSetPersistAfterFork(enable c.Int) c.Int

func UnstableThreadStateResetStackProtection added in v0.2.3

func UnstableThreadStateResetStackProtection(tstate *ThreadState)

Reset the stack protection start address and stack protection size of a Python thread state

func UnstableThreadStateSetStackProtection added in v0.2.3

func UnstableThreadStateSetStackProtection(tstate *ThreadState, stack_start_addr unsafe.Pointer, stack_size c.SizeT) c.Int

Set the stack protection start address and stack protection size of a Python thread state

func UnstableTryIncRef added in v0.2.3

func UnstableTryIncRef(_llcppg_param1 *Object) c.Int

Increments the reference count of the object, if it's not zero. PyUnstable_EnableTryIncRef() should be called on the object before calling this function in order to avoid spurious failures.

func UnstableTypeAssignVersionTag added in v0.2.3

func UnstableTypeAssignVersionTag(type_ *TypeObject) c.Int

Attempt to assign a version tag to the given type.

Returns 1 if the type already had a valid version tag or a new one was assigned, or 0 if a new tag could not be assigned.

func UnstableWritePerfMapEntry added in v0.2.0

func UnstableWritePerfMapEntry(code_addr unsafe.Pointer, code_size c.Uint, entry_name *c.Char) c.Int

func Unstable_GC_VisitObjects added in v0.2.0

func Unstable_GC_VisitObjects(callback GcvisitobjectsT, arg unsafe.Pointer)

func WeakrefGetRef added in v0.2.3

func WeakrefGetRef(ref *Object, pobj **Object) c.Int

func WeakrefIsDead added in v0.2.3

func WeakrefIsDead(ref *Object) c.Int

Test if a weak reference is dead.

func X_ArgParseTupleAndKeywordsFast added in v0.2.0

func X_ArgParseTupleAndKeywordsFast(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *X_ArgParser, __llgo_va_list ...any) c.Int

func X_BreakPoint added in v0.2.0

func X_BreakPoint()

func X_BytesResize added in v0.2.0

func X_BytesResize(_llcppg_param1 **Object, _llcppg_param2 SsizeT) c.Int

func X_CodeCheckLineNumber added in v0.2.0

func X_CodeCheckLineNumber(lasti c.Int, bounds *CodeAddressRange) c.Int

Update *bounds to describe the first and one-past-the-last instructions in the same line as lasti. Return the number of that line.

func X_Dealloc added in v0.2.0

func X_Dealloc(_llcppg_param1 *Object)

func X_DecRef added in v0.2.0

func X_DecRef(_llcppg_param1 *Object)

func X_ErrBadInternalCall added in v0.2.0

func X_ErrBadInternalCall(filename *c.Char, lineno c.Int)

func X_ErrChainExceptions1 added in v0.2.0

func X_ErrChainExceptions1(_llcppg_param1 *Object)

Context manipulation (PEP 3134)

func X_EvalSliceIndex added in v0.2.0

func X_EvalSliceIndex(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

func X_EvalSliceIndexNotNone added in v0.2.0

func X_EvalSliceIndexNotNone(_llcppg_param1 *Object, _llcppg_param2 *SsizeT) c.Int

func X_FatalErrorFunc added in v0.2.0

func X_FatalErrorFunc(func_ *c.Char, message *c.Char)

func X_ForgetReference added in v0.2.0

func X_ForgetReference(op *Object)

func X_IncRef added in v0.2.0

func X_IncRef(_llcppg_param1 *Object)

Similar to Py_IncRef() and Py_DecRef() but the argument must be non-NULL. Private functions used by Py_INCREF() and Py_DECREF().

func X_InterpreterStateRequireIDRef added in v0.2.0

func X_InterpreterStateRequireIDRef(_llcppg_param1 *InterpreterState, _llcppg_param2 c.Int)

func X_InterpreterStateRequiresIDRef added in v0.2.0

func X_InterpreterStateRequiresIDRef(_llcppg_param1 *InterpreterState) c.Int

private interpreter helpers

func X_InterpreterStateSetEvalFrameFunc added in v0.2.0

func X_InterpreterStateSetEvalFrameFunc(interp *InterpreterState, eval_frame X_FrameEvalFunction)

func X_LongAsByteArray added in v0.2.0

func X_LongAsByteArray(v *LongObject, bytes *uint8, n c.SizeT, little_endian c.Int, is_signed c.Int, with_exceptions c.Int) c.Int

_PyLong_AsByteArray: Convert the least-significant 8*n bits of long v to a base-256 integer, stored in array bytes. Normally return 0, return -1 on error. If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and the LSB at bytes[n-1]. If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes are filled and there's nothing special about bit 0x80 of the MSB. If is_signed is 1/true, bytes is filled with the 2's-complement representation of v's value. Bit 0x80 of the MSB is the sign bit. Error returns (-1): + is_signed is 0 and v < 0. TypeError is set in this case, and bytes isn't altered. + n isn't big enough to hold the full mathematical value of v. For example, if is_signed is 0 and there are more digits in the v than fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of being large enough to hold a sign bit. OverflowError is set in this case, but bytes holds the least-significant n bytes of the true value.

func X_LongNumBits added in v0.2.0

func X_LongNumBits(v *Object) c.Int64T

_PyLong_NumBits. Return the number of bits needed to represent the absolute value of a long. For example, this returns 1 for 1 and -1, 2 for 2 and -2, and 2 for 3 and -3. It returns 0 for 0. v must not be NULL, and must be a normalized long. Always successful.

func X_LongSign added in v0.2.0

func X_LongSign(v *Object) c.Int

func X_MonitoringFireBranchEvent added in v0.2.0

func X_MonitoringFireBranchEvent(state *MonitoringState, codelike *Object, offset c.Int32T, target_offset *Object) c.Int

func X_MonitoringFireBranchLeftEvent added in v0.2.0

func X_MonitoringFireBranchLeftEvent(state *MonitoringState, codelike *Object, offset c.Int32T, target_offset *Object) c.Int

func X_MonitoringFireBranchRightEvent added in v0.2.0

func X_MonitoringFireBranchRightEvent(state *MonitoringState, codelike *Object, offset c.Int32T, target_offset *Object) c.Int

func X_MonitoringFireCRaiseEvent added in v0.2.0

func X_MonitoringFireCRaiseEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFireCReturnEvent added in v0.2.0

func X_MonitoringFireCReturnEvent(state *MonitoringState, codelike *Object, offset c.Int32T, retval *Object) c.Int

func X_MonitoringFireCallEvent added in v0.2.0

func X_MonitoringFireCallEvent(state *MonitoringState, codelike *Object, offset c.Int32T, callable *Object, arg0 *Object) c.Int

func X_MonitoringFireExceptionHandledEvent added in v0.2.0

func X_MonitoringFireExceptionHandledEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFireJumpEvent added in v0.2.0

func X_MonitoringFireJumpEvent(state *MonitoringState, codelike *Object, offset c.Int32T, target_offset *Object) c.Int

func X_MonitoringFireLineEvent added in v0.2.0

func X_MonitoringFireLineEvent(state *MonitoringState, codelike *Object, offset c.Int32T, lineno c.Int) c.Int

func X_MonitoringFirePyResumeEvent added in v0.2.0

func X_MonitoringFirePyResumeEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFirePyReturnEvent added in v0.2.0

func X_MonitoringFirePyReturnEvent(state *MonitoringState, codelike *Object, offset c.Int32T, retval *Object) c.Int

func X_MonitoringFirePyStartEvent added in v0.2.0

func X_MonitoringFirePyStartEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFirePyThrowEvent added in v0.2.0

func X_MonitoringFirePyThrowEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFirePyUnwindEvent added in v0.2.0

func X_MonitoringFirePyUnwindEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFirePyYieldEvent added in v0.2.0

func X_MonitoringFirePyYieldEvent(state *MonitoringState, codelike *Object, offset c.Int32T, retval *Object) c.Int

func X_MonitoringFireRaiseEvent added in v0.2.0

func X_MonitoringFireRaiseEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFireReraiseEvent added in v0.2.0

func X_MonitoringFireReraiseEvent(state *MonitoringState, codelike *Object, offset c.Int32T) c.Int

func X_MonitoringFireStopIterationEvent added in v0.2.0

func X_MonitoringFireStopIterationEvent(state *MonitoringState, codelike *Object, offset c.Int32T, value *Object) c.Int

func X_NewReference added in v0.2.0

func X_NewReference(op *Object)

func X_NewReferenceNoTotal added in v0.2.0

func X_NewReferenceNoTotal(op *Object)

func X_ObjectAssertFailed added in v0.2.0

func X_ObjectAssertFailed(obj *Object, expr *c.Char, msg *c.Char, file *c.Char, line c.Int, function *c.Char)

Declare and define _PyObject_AssertFailed() even when NDEBUG is defined, to avoid causing compiler/linker errors when building extensions without NDEBUG against a Python built with NDEBUG defined.

msg, expr and function can be NULL.

func X_ObjectDump added in v0.2.0

func X_ObjectDump(_llcppg_param1 *Object)

func X_ObjectGenericSetAttrWithDict added in v0.2.0

func X_ObjectGenericSetAttrWithDict(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object, _llcppg_param4 *Object) c.Int

func X_ObjectSetManagedDict added in v0.2.0

func X_ObjectSetManagedDict(obj *Object, new_dict *Object) c.Int

func X_ReachedRecursionLimitWithMargin added in v0.2.0

func X_ReachedRecursionLimitWithMargin(tstate *ThreadState, margin_count c.Int) c.Int

func X_ResurrectReference added in v0.2.0

func X_ResurrectReference(op *Object)

func X_SetRefcnt added in v0.2.0

func X_SetRefcnt(ob *Object, refcnt SsizeT)

Py_SET_REFCNT() implementation for stable ABI

func X_SliceGetLongIndices added in v0.2.0

func X_SliceGetLongIndices(self *SliceObject, length *Object, start_ptr **Object, stop_ptr **Object, step_ptr **Object) c.Int

func X_TrashThreadDepositObject added in v0.2.0

func X_TrashThreadDepositObject(tstate *ThreadState, op *Object)

func X_TrashThreadDestroyChain added in v0.2.0

func X_TrashThreadDestroyChain(tstate *ThreadState)

func X_TupleResize added in v0.2.0

func X_TupleResize(_llcppg_param1 **Object, _llcppg_param2 SsizeT) c.Int

func X_TypeName added in v0.2.0

func X_TypeName(_llcppg_param1 *TypeObject) *c.Char

func X_UnicodeIsAlpha added in v0.2.0

func X_UnicodeIsAlpha(ch UCS4) c.Int

func X_UnicodeIsDecimalDigit added in v0.2.0

func X_UnicodeIsDecimalDigit(ch UCS4) c.Int

func X_UnicodeIsDigit added in v0.2.0

func X_UnicodeIsDigit(ch UCS4) c.Int

func X_UnicodeIsLinebreak added in v0.2.0

func X_UnicodeIsLinebreak(ch UCS4) c.Int

func X_UnicodeIsLowercase added in v0.2.0

func X_UnicodeIsLowercase(ch UCS4) c.Int

These should not be used directly. Use the Py_UNICODE_IS* and Py_UNICODE_TO* macros instead.

These APIs are implemented in Objects/unicodectype.c.

func X_UnicodeIsNumeric added in v0.2.0

func X_UnicodeIsNumeric(ch UCS4) c.Int

func X_UnicodeIsPrintable added in v0.2.0

func X_UnicodeIsPrintable(ch UCS4) c.Int

func X_UnicodeIsTitlecase added in v0.2.0

func X_UnicodeIsTitlecase(ch UCS4) c.Int

func X_UnicodeIsUppercase added in v0.2.0

func X_UnicodeIsUppercase(ch UCS4) c.Int

func X_UnicodeIsWhitespace added in v0.2.0

func X_UnicodeIsWhitespace(ch UCS4) c.Int

func X_UnicodeToDecimalDigit added in v0.2.0

func X_UnicodeToDecimalDigit(ch UCS4) c.Int

func X_UnicodeToDigit added in v0.2.0

func X_UnicodeToDigit(ch UCS4) c.Int

func X_UnicodeToNumeric added in v0.2.0

func X_UnicodeToNumeric(ch UCS4) c.Double

func X_UnicodeWriterDealloc added in v0.2.0

func X_UnicodeWriterDealloc(writer *X_UnicodeWriter)

Deallocate memory of a writer (clear its internal buffer).

func X_UnicodeWriterInit added in v0.2.0

func X_UnicodeWriterInit(writer *X_UnicodeWriter)

Initialize a Unicode writer.

By default, the minimum buffer size is 0 character and overallocation is disabled. Set min_length, min_char and overallocate attributes to control the allocation of the buffer.

func X_UnicodeWriterPrepareInternal added in v0.2.0

func X_UnicodeWriterPrepareInternal(writer *X_UnicodeWriter, length SsizeT, maxchar UCS4) c.Int

Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro instead.

func X_UnicodeWriterPrepareKindInternal added in v0.2.0

func X_UnicodeWriterPrepareKindInternal(writer *X_UnicodeWriter, kind c.Int) c.Int

Don't call this function directly, use the _PyUnicodeWriter_PrepareKind() macro instead.

func X_UnicodeWriterWriteASCIIString added in v0.2.0

func X_UnicodeWriterWriteASCIIString(writer *X_UnicodeWriter, str *c.Char, len SsizeT) c.Int

Append an ASCII-encoded byte string. Return 0 on success, raise an exception and return -1 on error.

func X_UnicodeWriterWriteChar added in v0.2.0

func X_UnicodeWriterWriteChar(writer *X_UnicodeWriter, ch UCS4) c.Int

Append a Unicode character. Return 0 on success, raise an exception and return -1 on error.

func X_UnicodeWriterWriteLatin1String added in v0.2.0

func X_UnicodeWriterWriteLatin1String(writer *X_UnicodeWriter, str *c.Char, len SsizeT) c.Int

Append a latin1-encoded byte string. Return 0 on success, raise an exception and return -1 on error.

func X_UnicodeWriterWriteStr added in v0.2.0

func X_UnicodeWriterWriteStr(writer *X_UnicodeWriter, str *Object) c.Int

Append a Unicode string. Return 0 on success, raise an exception and return -1 on error.

func X_UnicodeWriterWriteSubstring added in v0.2.0

func X_UnicodeWriterWriteSubstring(writer *X_UnicodeWriter, str *Object, start SsizeT, end SsizeT) c.Int

Append a substring of a Unicode string. Return 0 on success, raise an exception and return -1 on error.

func X_WeakrefClearRef added in v0.2.0

func X_WeakrefClearRef(self *WeakReference)

func X_cAbs added in v0.2.0

func X_cAbs(_llcppg_param1 Complex) c.Double

Types

type ASCIIObject added in v0.2.0

type ASCIIObject struct {
	ObBase Object
	Length SsizeT
	Hash   HashT
	State  _llcppg_anon_2
}

ASCII-only strings created through PyUnicode_New use the PyASCIIObject structure. state.ascii and state.compact are set, and the data immediately follow the structure. utf8_length can be found in the length field; the utf8 pointer is equal to the data pointer.

type Allocfunc

type Allocfunc = func(_llcppg_param1 *TypeObject, _llcppg_param2 SsizeT) *Object

llgo:type C

type AsyncGenObject added in v0.2.0

type AsyncGenObject = X_AsyncGenObject

--- Asynchronous Generators --------------------------------------------

type AsyncMethods added in v0.2.0

type AsyncMethods struct {
	AmAwait Unaryfunc
	AmAiter Unaryfunc
	AmAnext Unaryfunc
	AmSend  Sendfunc
}

type AtexitDatacallbackfunc

type AtexitDatacallbackfunc = func(_llcppg_param1 unsafe.Pointer)

llgo:type C

type AttributeErrorObject added in v0.2.0

type AttributeErrorObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Obj             *Object
	Name            *Object
}

type AuditHookFunction added in v0.2.0

type AuditHookFunction = func(_llcppg_param1 *c.Char, _llcppg_param2 *Object, _llcppg_param3 unsafe.Pointer) c.Int

llgo:type C

type BaseExceptionGroupObject added in v0.2.0

type BaseExceptionGroupObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Msg             *Object
	Excs            *Object
	ExcsStr         *Object
}

type BaseExceptionObject added in v0.2.0

type BaseExceptionObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
}

type Binaryfunc

type Binaryfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

llgo:type C

type Buffer added in v0.2.0

type Buffer struct {
	Buf        unsafe.Pointer
	Obj        *Object
	Len        SsizeT
	Itemsize   SsizeT
	Readonly   c.Int
	Ndim       c.Int
	Format     *c.Char
	Shape      *SsizeT
	Strides    *SsizeT
	Suboffsets *SsizeT
	Internal   unsafe.Pointer
}

=== New Buffer API ============================================ Limited API and stable ABI since Python 3.11

Py_buffer struct layout and size is now part of the stable abi3. The struct layout and size must not be changed in any way, as it would break the ABI.

func PickleBufferGetBuffer added in v0.2.3

func PickleBufferGetBuffer(_llcppg_param1 *Object) *Buffer

Get the PickleBuffer's underlying view to the original object (NULL if released)

type BufferProcs added in v0.2.0

type BufferProcs struct {
	BfGetbuffer     Getbufferproc
	BfReleasebuffer Releasebufferproc
}

type ByteArrayObject added in v0.2.0

type ByteArrayObject struct {
	ObBase    VarObject
	ObAlloc   SsizeT
	ObBytes   *c.Char
	ObStart   *c.Char
	ObExports SsizeT
}

Object layout

func ByteArrayFromStringAndSize added in v0.2.0

func ByteArrayFromStringAndSize(_llcppg_param1 *c.Char, _llcppg_param2 SsizeT) *ByteArrayObject

func (*ByteArrayObject) AsString added in v0.2.3

func (self *ByteArrayObject) AsString() *c.Char

llgo:link (*ByteArrayObject).AsString C.PyByteArray_AsString

func (*ByteArrayObject) Concat added in v0.2.3

func (self *ByteArrayObject) Concat(_llcppg_param2 *Object) *Object

llgo:link (*ByteArrayObject).Concat C.PyByteArray_Concat

func (*ByteArrayObject) Resize added in v0.2.3

func (self *ByteArrayObject) Resize(_llcppg_param2 SsizeT) c.Int

llgo:link (*ByteArrayObject).Resize C.PyByteArray_Resize

func (*ByteArrayObject) Size added in v0.2.3

func (self *ByteArrayObject) Size() SsizeT

llgo:link (*ByteArrayObject).Size C.PyByteArray_Size

type BytesObject added in v0.2.0

type BytesObject struct {
	ObBase  VarObject
	ObShash HashT
	ObSval  [1]c.Char
}

func BytesFromFormat added in v0.2.0

func BytesFromFormat(_llcppg_param1 *c.Char, __llgo_va_list ...any) *BytesObject

func BytesFromFormatV added in v0.2.4

func BytesFromFormatV(_llcppg_param1 *c.Char, _llcppg_param2 c.VaList) *BytesObject

func BytesFromString added in v0.2.0

func BytesFromString(_llcppg_param1 *c.Char) *BytesObject

func BytesFromStringAndSize added in v0.2.0

func BytesFromStringAndSize(_llcppg_param1 *c.Char, _llcppg_param2 SsizeT) *BytesObject

func (*BytesObject) AsString added in v0.2.3

func (self *BytesObject) AsString() *c.Char

llgo:link (*BytesObject).AsString C.PyBytes_AsString

func (*BytesObject) AsStringAndSize added in v0.2.3

func (self *BytesObject) AsStringAndSize(s **c.Char, len *SsizeT) c.Int

Provides access to the internal data buffer and size of a bytes object. Passing NULL as len parameter will force the string buffer to be 0-terminated (passing a string with embedded NUL characters will cause an exception).

llgo:link (*BytesObject).AsStringAndSize C.PyBytes_AsStringAndSize

func (*BytesObject) Join added in v0.2.3

func (self *BytesObject) Join(iterable *Object) *Object

llgo:link (*BytesObject).Join C.PyBytes_Join

func (*BytesObject) Repr added in v0.2.3

func (self *BytesObject) Repr(_llcppg_param2 c.Int) *Object

llgo:link (*BytesObject).Repr C.PyBytes_Repr

func (*BytesObject) Size added in v0.2.3

func (self *BytesObject) Size() SsizeT

llgo:link (*BytesObject).Size C.PyBytes_Size

type CFunction added in v0.2.0

type CFunction = func(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

llgo:type C

type CFunctionFast added in v0.2.0

type CFunctionFast = func(_llcppg_param1 *Object, _llcppg_param2 **Object, _llcppg_param3 SsizeT) *Object

llgo:type C

type CFunctionFastWithKeywords added in v0.2.0

type CFunctionFastWithKeywords = func(_llcppg_param1 *Object, _llcppg_param2 **Object, _llcppg_param3 SsizeT, _llcppg_param4 *Object) *Object

llgo:type C

type CFunctionObject added in v0.2.0

type CFunctionObject struct {
	ObBase       Object
	MMl          *MethodDef
	MSelf        *Object
	MModule      *Object
	MWeakreflist *Object
	Vectorcall   Vectorcallfunc
}

PyCFunctionObject structure

func NewCFunction added in v0.2.3

func NewCFunction(_llcppg_param1 *MethodDef, _llcppg_param2 *Object) *CFunctionObject

PyCFunction_New is declared as a function for stable ABI (declaration is needed for e.g. GCC with -fvisibility=hidden), but redefined as a macro that calls PyCFunction_NewEx.

func (*CFunctionObject) Flags added in v0.2.3

func (self *CFunctionObject) Flags() c.Int

llgo:link (*CFunctionObject).Flags C.PyCFunction_GetFlags

func (*CFunctionObject) Function added in v0.2.3

func (self *CFunctionObject) Function() CFunction

llgo:link (*CFunctionObject).Function C.PyCFunction_GetFunction

func (*CFunctionObject) Self added in v0.2.3

func (self *CFunctionObject) Self() *Object

llgo:link (*CFunctionObject).Self C.PyCFunction_GetSelf

type CFunctionWithKeywords added in v0.2.0

type CFunctionWithKeywords = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

llgo:type C

type CMethod added in v0.2.0

type CMethod = func(_llcppg_param1 *Object, _llcppg_param2 *TypeObject, _llcppg_param3 **Object, _llcppg_param4 SsizeT, _llcppg_param5 *Object) *Object

llgo:type C

type CMethodObject added in v0.2.0

type CMethodObject struct {
	Func    CFunctionObject
	MmClass *TypeObject
}

PyCMethodObject structure

func NewCMethod added in v0.2.3

func NewCMethod(_llcppg_param1 *MethodDef, _llcppg_param2 *Object, _llcppg_param3 *Object, _llcppg_param4 *TypeObject) *CMethodObject

type CapsuleDestructor added in v0.2.0

type CapsuleDestructor = func(_llcppg_param1 *Object)

llgo:type C

func CapsuleGetDestructor added in v0.2.3

func CapsuleGetDestructor(capsule *Object) CapsuleDestructor

type CellObject added in v0.2.0

type CellObject struct {
	ObBase Object
	ObRef  *Object
}

func NewCell added in v0.2.3

func NewCell(_llcppg_param1 *Object) *CellObject

func (*CellObject) Get added in v0.2.3

func (self *CellObject) Get() *Object

llgo:link (*CellObject).Get C.PyCell_Get

func (*CellObject) Set added in v0.2.3

func (self *CellObject) Set(_llcppg_param2 *Object) c.Int

llgo:link (*CellObject).Set C.PyCell_Set

type CodeAddressRange added in v0.2.0

type CodeAddressRange = X_lineOffsets

type CodeEvent added in v0.2.0

type CodeEvent c.Uint
const (
	CODE_EVENT_CREATE  CodeEvent = 0
	CODE_EVENT_DESTROY CodeEvent = 1
)

type CodeObject added in v0.2.0

type CodeObject struct {
	ObBase                     VarObject
	CoConsts                   *Object
	CoNames                    *Object
	CoExceptiontable           *Object
	CoFlags                    c.Int
	CoArgcount                 c.Int
	CoPosonlyargcount          c.Int
	CoKwonlyargcount           c.Int
	CoStacksize                c.Int
	CoFirstlineno              c.Int
	CoNlocalsplus              c.Int
	CoFramesize                c.Int
	CoNlocals                  c.Int
	CoNcellvars                c.Int
	CoNfreevars                c.Int
	CoVersion                  c.Uint32T
	CoLocalsplusnames          *Object
	CoLocalspluskinds          *Object
	CoFilename                 *Object
	CoName                     *Object
	CoQualname                 *Object
	CoLinetable                *Object
	CoWeakreflist              *Object
	CoExecutors                *X_ExecutorArray
	X_coCached                 *X_CoCached
	X_coInstrumentationVersion c.UintptrT
	X_coMonitoring             *X_CoMonitoringData
	X_coUniqueId               SsizeT
	X_coFirsttraceable         c.Int
	CoExtra                    unsafe.Pointer
	CoCodeAdaptive             [1]c.Char
}

Bytecode object

func CodeNewEmpty added in v0.2.0

func CodeNewEmpty(filename *c.Char, funcname *c.Char, firstlineno c.Int) *CodeObject

Creates a new empty code object with the specified source location.

func UnstableCodeNew added in v0.2.0

func UnstableCodeNew(_llcppg_param1 c.Int, _llcppg_param2 c.Int, _llcppg_param3 c.Int, _llcppg_param4 c.Int, _llcppg_param5 c.Int, _llcppg_param6 *Object, _llcppg_param7 *Object, _llcppg_param8 *Object, _llcppg_param9 *Object, _llcppg_param10 *Object, _llcppg_param11 *Object, _llcppg_param12 *Object, _llcppg_param13 *Object, _llcppg_param14 *Object, _llcppg_param15 c.Int, _llcppg_param16 *Object, _llcppg_param17 *Object) *CodeObject

Unstable public interface

func UnstableCodeNewWithPosOnlyArgs added in v0.2.0

func UnstableCodeNewWithPosOnlyArgs(_llcppg_param1 c.Int, _llcppg_param2 c.Int, _llcppg_param3 c.Int, _llcppg_param4 c.Int, _llcppg_param5 c.Int, _llcppg_param6 c.Int, _llcppg_param7 *Object, _llcppg_param8 *Object, _llcppg_param9 *Object, _llcppg_param10 *Object, _llcppg_param11 *Object, _llcppg_param12 *Object, _llcppg_param13 *Object, _llcppg_param14 *Object, _llcppg_param15 *Object, _llcppg_param16 c.Int, _llcppg_param17 *Object, _llcppg_param18 *Object) *CodeObject

func (*CodeObject) Addr2Line added in v0.2.3

func (self *CodeObject) Addr2Line(_llcppg_param2 c.Int) c.Int

Return the line number associated with the specified bytecode index in this code object. If you just need the line number of a frame, use PyFrame_GetLineNumber() instead.

llgo:link (*CodeObject).Addr2Line C.PyCode_Addr2Line

func (*CodeObject) Addr2Location added in v0.2.3

func (self *CodeObject) Addr2Location(_llcppg_param2 c.Int, _llcppg_param3 *c.Int, _llcppg_param4 *c.Int, _llcppg_param5 *c.Int, _llcppg_param6 *c.Int) c.Int

llgo:link (*CodeObject).Addr2Location C.PyCode_Addr2Location

func (*CodeObject) Cellvars added in v0.2.3

func (self *CodeObject) Cellvars() *Object

Equivalent to getattr(code, 'co_cellvars') in Python.

llgo:link (*CodeObject).Cellvars C.PyCode_GetCellvars

func (*CodeObject) Freevars added in v0.2.3

func (self *CodeObject) Freevars() *Object

Equivalent to getattr(code, 'co_freevars') in Python.

llgo:link (*CodeObject).Freevars C.PyCode_GetFreevars

func (*CodeObject) Get added in v0.2.3

func (self *CodeObject) Get() *Object

Equivalent to getattr(code, 'co_code') in Python. Returns a strong reference to a bytes object.

llgo:link (*CodeObject).Get C.PyCode_GetCode

func (*CodeObject) Optimize added in v0.2.3

func (self *CodeObject) Optimize(consts *Object, names *Object, lnotab *Object) *Object

llgo:link (*CodeObject).Optimize C.PyCode_Optimize

func (*CodeObject) Varnames added in v0.2.3

func (self *CodeObject) Varnames() *Object

Equivalent to getattr(code, 'co_varnames') in Python.

llgo:link (*CodeObject).Varnames C.PyCode_GetVarnames

type CodeWatchCallback added in v0.2.0

type CodeWatchCallback = func(_llcppg_param1 CodeEvent, _llcppg_param2 *CodeObject) c.Int

A callback that is invoked for different events in a code object's lifecycle.

The callback is invoked with a borrowed reference to co, after it is created and before it is destroyed.

If the callback sets an exception, it must return -1. Otherwise it should return 0.

llgo:type C

type CompactUnicodeObject added in v0.2.0

type CompactUnicodeObject struct {
	X_base     ASCIIObject
	Utf8Length SsizeT
	Utf8       *c.Char
}

Non-ASCII strings allocated through PyUnicode_New use the PyCompactUnicodeObject structure. state.compact is set, and the data immediately follow the structure.

type CompilerFlags added in v0.2.0

type CompilerFlags struct {
	CfFlags          c.Int
	CfFeatureVersion c.Int
}

type Complex added in v0.2.0

type Complex struct {
	Real c.Double
	Imag c.Double
}

func X_cDiff added in v0.2.0

func X_cDiff(_llcppg_param1 Complex, _llcppg_param2 Complex) Complex

func X_cNeg added in v0.2.0

func X_cNeg(_llcppg_param1 Complex) Complex

func X_cPow added in v0.2.0

func X_cPow(_llcppg_param1 Complex, _llcppg_param2 Complex) Complex

func X_cProd added in v0.2.0

func X_cProd(_llcppg_param1 Complex, _llcppg_param2 Complex) Complex

func X_cQuot added in v0.2.0

func X_cQuot(_llcppg_param1 Complex, _llcppg_param2 Complex) Complex

func X_cSum added in v0.2.0

func X_cSum(_llcppg_param1 Complex, _llcppg_param2 Complex) Complex

Operations on complex numbers.

type ComplexObject added in v0.2.0

type ComplexObject struct {
	ObBase Object
	Cval   Complex
}

PyComplexObject represents a complex number with double-precision real and imaginary parts.

func ComplexFromCComplex added in v0.2.4

func ComplexFromCComplex(_llcppg_param1 Complex) *ComplexObject

func ComplexFromDoubles added in v0.2.0

func ComplexFromDoubles(real c.Double, imag c.Double) *ComplexObject

func (*ComplexObject) AsC added in v0.2.3

func (self *ComplexObject) AsC() Complex

llgo:link (*ComplexObject).AsC C.PyComplex_AsCComplex

func (*ComplexObject) ImagAsDouble added in v0.2.3

func (self *ComplexObject) ImagAsDouble() c.Double

llgo:link (*ComplexObject).ImagAsDouble C.PyComplex_ImagAsDouble

func (*ComplexObject) RealAsDouble added in v0.2.3

func (self *ComplexObject) RealAsDouble() c.Double

llgo:link (*ComplexObject).RealAsDouble C.PyComplex_RealAsDouble

type Config added in v0.2.0

type Config struct {
	X_configInit          c.Int
	Isolated              c.Int
	UseEnvironment        c.Int
	DevMode               c.Int
	InstallSignalHandlers c.Int
	UseHashSeed           c.Int
	HashSeed              c.Ulong
	Faulthandler          c.Int
	Tracemalloc           c.Int
	PerfProfiling         c.Int
	RemoteDebug           c.Int
	ImportTime            c.Int
	CodeDebugRanges       c.Int
	ShowRefCount          c.Int
	DumpRefs              c.Int
	DumpRefsFile          *c.WcharT
	MallocStats           c.Int
	FilesystemEncoding    *c.WcharT
	FilesystemErrors      *c.WcharT
	PycachePrefix         *c.WcharT
	ParseArgv             c.Int
	OrigArgv              WideStringList
	Argv                  WideStringList
	Xoptions              WideStringList
	Warnoptions           WideStringList
	SiteImport            c.Int
	BytesWarning          c.Int
	WarnDefaultEncoding   c.Int
	Inspect               c.Int
	Interactive           c.Int
	OptimizationLevel     c.Int
	ParserDebug           c.Int
	WriteBytecode         c.Int
	Verbose               c.Int
	Quiet                 c.Int
	UserSiteDirectory     c.Int
	ConfigureCStdio       c.Int
	BufferedStdio         c.Int
	StdioEncoding         *c.WcharT
	StdioErrors           *c.WcharT
	CheckHashPycsMode     *c.WcharT
	UseFrozenModules      c.Int
	SafePath              c.Int
	IntMaxStrDigits       c.Int
	ThreadInheritContext  c.Int
	ContextAwareWarnings  c.Int
	UseSystemLogger       c.Int
	CpuCount              c.Int
	PathconfigWarnings    c.Int
	ProgramName           *c.WcharT
	PythonpathEnv         *c.WcharT
	Home                  *c.WcharT
	Platlibdir            *c.WcharT
	ModuleSearchPathsSet  c.Int
	ModuleSearchPaths     WideStringList
	StdlibDir             *c.WcharT
	Executable            *c.WcharT
	BaseExecutable        *c.WcharT
	Prefix                *c.WcharT
	BasePrefix            *c.WcharT
	ExecPrefix            *c.WcharT
	BaseExecPrefix        *c.WcharT
	SkipSourceFirstLine   c.Int
	RunCommand            *c.WcharT
	RunModule             *c.WcharT
	RunFilename           *c.WcharT
	SysPath0              *c.WcharT
	X_installImportlib    c.Int
	X_initMain            c.Int
	X_isPythonBuild       c.Int
}

This structure is best documented in the Doc/c-api/init_config.rst file.

type Context added in v0.2.0

type Context = X_pycontextobject

type ContextEvent added in v0.2.0

type ContextEvent c.Uint
const CONTEXT_SWITCHED ContextEvent = 1

type ContextToken added in v0.2.0

type ContextToken = X_pycontexttokenobject

type ContextVar added in v0.2.0

type ContextVar = X_pycontextvarobject

type ContextWatchCallback added in v0.2.0

type ContextWatchCallback = func(_llcppg_param1 ContextEvent, _llcppg_param2 *Object) c.Int

Context object watcher callback function. The object passed to the callback is event-specific; see PyContextEvent for details.

if the callback returns with an exception set, it must return -1. Otherwise it should return 0

llgo:type C

type CoroObject added in v0.2.0

type CoroObject = X_CoroObject

--- PyCoroObject -------------------------------------------------------

type CriticalSection added in v0.2.0

type CriticalSection struct {
}

type CriticalSection2 added in v0.2.0

type CriticalSection2 struct {
}

type DescrObject added in v0.2.0

type DescrObject struct {
	ObBase    Object
	DType     *TypeObject
	DName     *Object
	DQualname *Object
}

Various kinds of descriptor objects

func (*DescrObject) IsData added in v0.2.3

func (self *DescrObject) IsData() c.Int

llgo:link (*DescrObject).IsData C.PyDescr_IsData

type Descrgetfunc

type Descrgetfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

llgo:type C

type Descrsetfunc

type Descrsetfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) c.Int

llgo:type C

type Destructor

type Destructor = func(_llcppg_param1 *Object)

llgo:type C

type DictKeysObject added in v0.2.0

type DictKeysObject = X_dictkeysobject

type DictObject added in v0.2.0

type DictObject struct {
	ObBase         Object
	MaUsed         SsizeT
	X_maWatcherTag c.Uint64T
	MaKeys         *DictKeysObject
	MaValues       *DictValues
}

The ma_values pointer is NULL for a combined table or points to an array of PyObject* for a split table

func NewDict added in v0.2.3

func NewDict() *DictObject

func (*DictObject) Clear added in v0.2.3

func (self *DictObject) Clear()

llgo:link (*DictObject).Clear C.PyDict_Clear

func (*DictObject) Contains added in v0.2.3

func (self *DictObject) Contains(key *Object) c.Int

llgo:link (*DictObject).Contains C.PyDict_Contains

func (*DictObject) ContainsString added in v0.2.3

func (self *DictObject) ContainsString(key *c.Char) c.Int

llgo:link (*DictObject).ContainsString C.PyDict_ContainsString

func (*DictObject) Copy added in v0.2.3

func (self *DictObject) Copy() *Object

llgo:link (*DictObject).Copy C.PyDict_Copy

func (*DictObject) DelItem added in v0.2.3

func (self *DictObject) DelItem(key *Object) c.Int

llgo:link (*DictObject).DelItem C.PyDict_DelItem

func (*DictObject) DelItemString added in v0.2.3

func (self *DictObject) DelItemString(key *c.Char) c.Int

llgo:link (*DictObject).DelItemString C.PyDict_DelItemString

func (*DictObject) Item added in v0.2.3

func (self *DictObject) Item(key *Object) *Object

llgo:link (*DictObject).Item C.PyDict_GetItem

func (*DictObject) ItemRef added in v0.2.3

func (self *DictObject) ItemRef(key *Object, result **Object) c.Int

Return the object from dictionary *op* which has a key *key*.

  • If the key is present, set *result to a new strong reference to the value and return 1.
  • If the key is missing, set *result to NULL and return 0 .
  • On error, raise an exception and return -1.

llgo:link (*DictObject).ItemRef C.PyDict_GetItemRef

func (*DictObject) ItemString added in v0.2.3

func (self *DictObject) ItemString(key *c.Char) *Object

llgo:link (*DictObject).ItemString C.PyDict_GetItemString

func (*DictObject) ItemStringRef added in v0.2.3

func (self *DictObject) ItemStringRef(key *c.Char, result **Object) c.Int

llgo:link (*DictObject).ItemStringRef C.PyDict_GetItemStringRef

func (*DictObject) ItemWithError added in v0.2.3

func (self *DictObject) ItemWithError(key *Object) *Object

llgo:link (*DictObject).ItemWithError C.PyDict_GetItemWithError

func (*DictObject) Items added in v0.2.3

func (self *DictObject) Items() *Object

llgo:link (*DictObject).Items C.PyDict_Items

func (*DictObject) Keys added in v0.2.3

func (self *DictObject) Keys() *Object

llgo:link (*DictObject).Keys C.PyDict_Keys

func (*DictObject) Merge added in v0.2.3

func (self *DictObject) Merge(other *Object, override c.Int) c.Int

PyDict_Merge updates/merges from a mapping object (an object that supports PyMapping_Keys() and PyObject_GetItem()). If override is true, the last occurrence of a key wins, else the first. The Python dict.update(other) is equivalent to PyDict_Merge(dict, other, 1).

llgo:link (*DictObject).Merge C.PyDict_Merge

func (*DictObject) MergeFromSeq2 added in v0.2.3

func (self *DictObject) MergeFromSeq2(seq2 *Object, override c.Int) c.Int

PyDict_MergeFromSeq2 updates/merges from an iterable object producing iterable objects of length 2. If override is true, the last occurrence of a key wins, else the first. The Python dict constructor dict(seq2) is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1).

llgo:link (*DictObject).MergeFromSeq2 C.PyDict_MergeFromSeq2

func (*DictObject) Next added in v0.2.3

func (self *DictObject) Next(pos *SsizeT, key **Object, value **Object) c.Int

llgo:link (*DictObject).Next C.PyDict_Next

func (*DictObject) Pop added in v0.2.3

func (self *DictObject) Pop(key *Object, result **Object) c.Int

llgo:link (*DictObject).Pop C.PyDict_Pop

func (*DictObject) PopString added in v0.2.3

func (self *DictObject) PopString(key *c.Char, result **Object) c.Int

llgo:link (*DictObject).PopString C.PyDict_PopString

func (*DictObject) SetDefault added in v0.2.3

func (self *DictObject) SetDefault(key *Object, defaultobj *Object) *Object

llgo:link (*DictObject).SetDefault C.PyDict_SetDefault

func (*DictObject) SetDefaultRef added in v0.2.3

func (self *DictObject) SetDefaultRef(key *Object, default_value *Object, result **Object) c.Int

Inserts `key` with a value `default_value`, if `key` is not already present in the dictionary. If `result` is not NULL, then the value associated with `key` is returned in `*result` (either the existing value, or the now inserted `default_value`). Returns:

-1 on error
 0 if `key` was not present and `default_value` was inserted
 1 if `key` was present and `default_value` was not inserted

llgo:link (*DictObject).SetDefaultRef C.PyDict_SetDefaultRef

func (*DictObject) SetItem added in v0.2.3

func (self *DictObject) SetItem(key *Object, item *Object) c.Int

llgo:link (*DictObject).SetItem C.PyDict_SetItem

func (*DictObject) SetItemString added in v0.2.3

func (self *DictObject) SetItemString(key *c.Char, item *Object) c.Int

llgo:link (*DictObject).SetItemString C.PyDict_SetItemString

func (*DictObject) Size added in v0.2.3

func (self *DictObject) Size() SsizeT

llgo:link (*DictObject).Size C.PyDict_Size

func (*DictObject) Update added in v0.2.3

func (self *DictObject) Update(other *Object) c.Int

PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1).

llgo:link (*DictObject).Update C.PyDict_Update

func (*DictObject) Values added in v0.2.3

func (self *DictObject) Values() *Object

llgo:link (*DictObject).Values C.PyDict_Values

type DictValues added in v0.2.0

type DictValues = X_dictvalues

type DictWatchCallback added in v0.2.0

type DictWatchCallback = func(_llcppg_param1 DictWatchEvent, _llcppg_param2 *Object, _llcppg_param3 *Object, _llcppg_param4 *Object) c.Int

Callback to be invoked when a watched dict is cleared, dealloced, or modified. In clear/dealloc case, key and new_value will be NULL. Otherwise, new_value will be the new value for key, NULL if key is being deleted.

llgo:type C

type DictWatchEvent added in v0.2.0

type DictWatchEvent c.Uint
const (
	Dict_EVENT_ADDED       DictWatchEvent = 0
	Dict_EVENT_MODIFIED    DictWatchEvent = 1
	Dict_EVENT_DELETED     DictWatchEvent = 2
	Dict_EVENT_CLONED      DictWatchEvent = 3
	Dict_EVENT_CLEARED     DictWatchEvent = 4
	Dict_EVENT_DEALLOCATED DictWatchEvent = 5
)

type Digit

type Digit = c.Uint32T

type EnvironmentErrorObject added in v0.2.0

type EnvironmentErrorObject = OSErrorObject

Compatibility typedefs

type FloatObject added in v0.2.0

type FloatObject struct {
	ObBase Object
	ObFval c.Double
}

func FloatFromDouble added in v0.2.0

func FloatFromDouble(_llcppg_param1 c.Double) *FloatObject

Return Python float from C double.

func FloatFromString added in v0.2.4

func FloatFromString(_llcppg_param1 *Object) *FloatObject

Return Python float from string PyObject.

func (*FloatObject) AsDouble added in v0.2.3

func (self *FloatObject) AsDouble() c.Double

Extract C double from Python float. The macro version trades safety for speed.

llgo:link (*FloatObject).AsDouble C.PyFloat_AsDouble

type FrameConstructor added in v0.2.0

type FrameConstructor struct {
	FcGlobals    *Object
	FcBuiltins   *Object
	FcName       *Object
	FcQualname   *Object
	FcCode       *Object
	FcDefaults   *Object
	FcKwdefaults *Object
	FcClosure    *Object
}

type FrameObject added in v0.2.0

type FrameObject = X_frame

func EvalGetFrame added in v0.2.0

func EvalGetFrame() *FrameObject

func ThreadStateGetFrame added in v0.2.3

func ThreadStateGetFrame(tstate *ThreadState) *FrameObject

func (*FrameObject) Back added in v0.2.3

func (self *FrameObject) Back() *FrameObject

llgo:link (*FrameObject).Back C.PyFrame_GetBack

func (*FrameObject) Builtins added in v0.2.3

func (self *FrameObject) Builtins() *Object

llgo:link (*FrameObject).Builtins C.PyFrame_GetBuiltins

func (*FrameObject) Code added in v0.2.3

func (self *FrameObject) Code() *CodeObject

llgo:link (*FrameObject).Code C.PyFrame_GetCode

func (*FrameObject) GenNewWithQualName added in v0.2.3

func (self *FrameObject) GenNewWithQualName(name *Object, qualname *Object) *Object

llgo:link (*FrameObject).GenNewWithQualName C.PyGen_NewWithQualName

func (*FrameObject) Generator added in v0.2.3

func (self *FrameObject) Generator() *Object

llgo:link (*FrameObject).Generator C.PyFrame_GetGenerator

func (*FrameObject) Globals added in v0.2.3

func (self *FrameObject) Globals() *Object

llgo:link (*FrameObject).Globals C.PyFrame_GetGlobals

func (*FrameObject) Lasti added in v0.2.3

func (self *FrameObject) Lasti() c.Int

llgo:link (*FrameObject).Lasti C.PyFrame_GetLasti

func (*FrameObject) LineNumber added in v0.2.3

func (self *FrameObject) LineNumber() c.Int

Return the line of code the frame is currently executing.

llgo:link (*FrameObject).LineNumber C.PyFrame_GetLineNumber

func (*FrameObject) Locals added in v0.2.3

func (self *FrameObject) Locals() *Object

llgo:link (*FrameObject).Locals C.PyFrame_GetLocals

func (*FrameObject) Var added in v0.2.3

func (self *FrameObject) Var(name *Object) *Object

llgo:link (*FrameObject).Var C.PyFrame_GetVar

func (*FrameObject) VarString added in v0.2.3

func (self *FrameObject) VarString(name *c.Char) *Object

llgo:link (*FrameObject).VarString C.PyFrame_GetVarString

type Freefunc

type Freefunc = func(_llcppg_param1 unsafe.Pointer)

llgo:type C

type FunctionObject added in v0.2.0

type FunctionObject struct {
	ObBase          Object
	FuncGlobals     *Object
	FuncBuiltins    *Object
	FuncName        *Object
	FuncQualname    *Object
	FuncCode        *Object
	FuncDefaults    *Object
	FuncKwdefaults  *Object
	FuncClosure     *Object
	FuncDoc         *Object
	FuncDict        *Object
	FuncWeakreflist *Object
	FuncModule      *Object
	FuncAnnotations *Object
	FuncAnnotate    *Object
	FuncTypeparams  *Object
	Vectorcall      Vectorcallfunc
	FuncVersion     c.Uint32T
}

Function objects and code objects should not be confused with each other:

Function objects are created by the execution of the 'def' statement. They reference a code object in their __code__ attribute, which is a purely syntactic object, i.e. nothing more than a compiled version of some source code lines. There is one code object per source code "fragment", but each code object can be referenced by zero or many function objects depending only on how many times the 'def' statement in the source was executed so far.

func NewFunction added in v0.2.3

func NewFunction(_llcppg_param1 *Object, _llcppg_param2 *Object) *FunctionObject

func (*FunctionObject) Annotations added in v0.2.3

func (self *FunctionObject) Annotations() *Object

llgo:link (*FunctionObject).Annotations C.PyFunction_GetAnnotations

func (*FunctionObject) Closure added in v0.2.3

func (self *FunctionObject) Closure() *Object

llgo:link (*FunctionObject).Closure C.PyFunction_GetClosure

func (*FunctionObject) Code added in v0.2.3

func (self *FunctionObject) Code() *Object

llgo:link (*FunctionObject).Code C.PyFunction_GetCode

func (*FunctionObject) Defaults added in v0.2.3

func (self *FunctionObject) Defaults() *Object

llgo:link (*FunctionObject).Defaults C.PyFunction_GetDefaults

func (*FunctionObject) Globals added in v0.2.3

func (self *FunctionObject) Globals() *Object

llgo:link (*FunctionObject).Globals C.PyFunction_GetGlobals

func (*FunctionObject) KwDefaults added in v0.2.3

func (self *FunctionObject) KwDefaults() *Object

llgo:link (*FunctionObject).KwDefaults C.PyFunction_GetKwDefaults

func (*FunctionObject) Module added in v0.2.3

func (self *FunctionObject) Module() *Object

llgo:link (*FunctionObject).Module C.PyFunction_GetModule

func (*FunctionObject) NewWithQualName added in v0.2.3

func (self *FunctionObject) NewWithQualName(_llcppg_param2 *Object, _llcppg_param3 *Object) *Object

llgo:link (*FunctionObject).NewWithQualName C.PyFunction_NewWithQualName

func (*FunctionObject) SetAnnotations added in v0.2.3

func (self *FunctionObject) SetAnnotations(_llcppg_param2 *Object) c.Int

llgo:link (*FunctionObject).SetAnnotations C.PyFunction_SetAnnotations

func (*FunctionObject) SetClosure added in v0.2.3

func (self *FunctionObject) SetClosure(_llcppg_param2 *Object) c.Int

llgo:link (*FunctionObject).SetClosure C.PyFunction_SetClosure

func (*FunctionObject) SetDefaults added in v0.2.3

func (self *FunctionObject) SetDefaults(_llcppg_param2 *Object) c.Int

llgo:link (*FunctionObject).SetDefaults C.PyFunction_SetDefaults

func (*FunctionObject) SetKwDefaults added in v0.2.3

func (self *FunctionObject) SetKwDefaults(_llcppg_param2 *Object) c.Int

llgo:link (*FunctionObject).SetKwDefaults C.PyFunction_SetKwDefaults

func (*FunctionObject) SetVectorcall added in v0.2.3

func (self *FunctionObject) SetVectorcall(_llcppg_param2 Vectorcallfunc)

llgo:link (*FunctionObject).SetVectorcall C.PyFunction_SetVectorcall

type FunctionWatchCallback added in v0.2.0

type FunctionWatchCallback = func(_llcppg_param1 FunctionWatchEvent, _llcppg_param2 *FunctionObject, _llcppg_param3 *Object) c.Int

A callback that is invoked for different events in a function's lifecycle.

The callback is invoked with a borrowed reference to func, after it is created and before it is modified or destroyed. The callback should not modify func.

When a function's code object, defaults, or kwdefaults are modified the callback will be invoked with the respective event and new_value will contain a borrowed reference to the new value that is about to be stored in the function. Otherwise the third argument is NULL.

If the callback returns with an exception set, it must return -1. Otherwise it should return 0.

llgo:type C

type FunctionWatchEvent added in v0.2.0

type FunctionWatchEvent c.Uint
const (
	Function_EVENT_CREATE            FunctionWatchEvent = 0
	Function_EVENT_DESTROY           FunctionWatchEvent = 1
	Function_EVENT_MODIFY_CODE       FunctionWatchEvent = 2
	Function_EVENT_MODIFY_DEFAULTS   FunctionWatchEvent = 3
	Function_EVENT_MODIFY_KWDEFAULTS FunctionWatchEvent = 4
)

type GILState_STATE added in v0.2.0

type GILState_STATE c.Uint
const (
	GILState_LOCKED   GILState_STATE = 0
	GILState_UNLOCKED GILState_STATE = 1
)

func GILStateEnsure added in v0.2.0

func GILStateEnsure() GILState_STATE

Ensure that the current thread is ready to call the Python C API, regardless of the current state of Python, or of its thread lock. This may be called as many times as desired by a thread so long as each call is matched with a call to PyGILState_Release(). In general, other thread-state APIs may be used between _Ensure() and _Release() calls, so long as the thread-state is restored to its previous state before the Release(). For example, normal use of the Py_BEGIN_ALLOW_THREADS/ Py_END_ALLOW_THREADS macros are acceptable.

The return value is an opaque "handle" to the thread state when PyGILState_Ensure() was called, and must be passed to PyGILState_Release() to ensure Python is left in the same state. Even though recursive calls are allowed, these handles can *not* be shared - each unique call to PyGILState_Ensure must save the handle for its call to PyGILState_Release.

When the function returns, the current thread will hold the GIL.

Failure is a fatal error.

type GcvisitobjectsT

type GcvisitobjectsT = func(_llcppg_param1 *Object, _llcppg_param2 unsafe.Pointer) c.Int

Visit all live GC-capable objects, similar to gc.get_objects(None). The supplied callback is called on every such object with the void* arg set to the supplied arg. Returning 0 from the callback ends iteration, returning 1 allows iteration to continue. Returning any other value may result in undefined behaviour.

If new objects are (de)allocated by the callback it is undefined if they will be visited.

Garbage collection is disabled during operation. Explicitly running a collection in the callback may lead to undefined behaviour e.g. visiting the same objects multiple times or not at all.

llgo:type C

type GenObject added in v0.2.0

type GenObject = X_GenObject

--- Generators ---------------------------------------------------------

func (*GenObject) Code added in v0.2.3

func (self *GenObject) Code() *CodeObject

llgo:link (*GenObject).Code C.PyGen_GetCode

type GetSetDef added in v0.2.0

type GetSetDef struct {
	Name    *c.Char
	Get     Getter
	Set     Setter
	Doc     *c.Char
	Closure unsafe.Pointer
}

type GetSetDescrObject added in v0.2.0

type GetSetDescrObject struct {
	DCommon DescrObject
	DGetset *GetSetDef
}

type Getattrfunc

type Getattrfunc = func(_llcppg_param1 *Object, _llcppg_param2 *c.Char) *Object

llgo:type C

type Getattrofunc

type Getattrofunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

llgo:type C

type Getbufferproc

type Getbufferproc = func(_llcppg_param1 *Object, _llcppg_param2 *Buffer, _llcppg_param3 c.Int) c.Int

llgo:type C

type Getiterfunc

type Getiterfunc = func(_llcppg_param1 *Object) *Object

llgo:type C

type Getter

type Getter = func(_llcppg_param1 *Object, _llcppg_param2 unsafe.Pointer) *Object

llgo:type C

type HashFuncDef added in v0.2.0

type HashFuncDef struct {
	Hash     func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 SsizeT) HashT
	Name     *c.Char
	HashBits c.Int
	SeedBits c.Int
}

hash function definition

llgo:type C

func HashGetFuncDef added in v0.2.0

func HashGetFuncDef() *HashFuncDef

type HashT added in v0.2.0

type HashT = SsizeT

func HashBuffer added in v0.2.0

func HashBuffer(ptr unsafe.Pointer, len SsizeT) HashT

func HashPointer added in v0.2.0

func HashPointer(ptr unsafe.Pointer) HashT

func X_HashDouble added in v0.2.0

func X_HashDouble(_llcppg_param1 *Object, _llcppg_param2 c.Double) HashT

Helpers for hash functions

type Hashfunc

type Hashfunc = func(_llcppg_param1 *Object) HashT

llgo:type C

type HeapTypeObject added in v0.2.0

type HeapTypeObject = X_heaptypeobject

The *real* layout of a type object when allocated on the heap

type ImportErrorObject added in v0.2.0

type ImportErrorObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Msg             *Object
	Name            *Object
	Path            *Object
	NameFrom        *Object
}

type InitConfig added in v0.2.0

type InitConfig struct {
}

func InitConfigCreate added in v0.2.0

func InitConfigCreate() *InitConfig

type Initproc

type Initproc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) c.Int

llgo:type C

type Inquiry

type Inquiry = func(_llcppg_param1 *Object) c.Int

llgo:type C

type InstanceMethodObject added in v0.2.0

type InstanceMethodObject struct {
	ObBase Object
	Func   *Object
}

func NewInstanceMethod added in v0.2.3

func NewInstanceMethod(_llcppg_param1 *Object) *InstanceMethodObject

func (*InstanceMethodObject) Function added in v0.2.3

func (self *InstanceMethodObject) Function() *Object

llgo:link (*InstanceMethodObject).Function C.PyInstanceMethod_Function

type InterpreterConfig added in v0.2.0

type InterpreterConfig struct {
	UseMainObmalloc            c.Int
	AllowFork                  c.Int
	AllowExec                  c.Int
	AllowThreads               c.Int
	AllowDaemonThreads         c.Int
	CheckMultiInterpExtensions c.Int
	Gil                        c.Int
}

type InterpreterState added in v0.2.0

type InterpreterState = X_is

func InterpreterStateGet added in v0.2.0

func InterpreterStateGet() *InterpreterState

New in 3.9 Get the current interpreter state.

Issue a fatal error if there no current Python thread state or no current interpreter. It cannot return NULL.

The caller must hold the GIL.

func InterpreterStateHead added in v0.2.0

func InterpreterStateHead() *InterpreterState

func InterpreterStateMain added in v0.2.0

func InterpreterStateMain() *InterpreterState

Routines for advanced debuggers, requested by David Beazley. Don't use unless you know what you are doing!

func InterpreterStateNew added in v0.2.0

func InterpreterStateNew() *InterpreterState

func InterpreterStateNext added in v0.2.3

func InterpreterStateNext(_llcppg_param1 *InterpreterState) *InterpreterState

func ThreadStateGetInterpreter added in v0.2.3

func ThreadStateGetInterpreter(tstate *ThreadState) *InterpreterState

New in 3.9

type IntptrT added in v0.2.0

type IntptrT = c.IntptrT

type Iternextfunc

type Iternextfunc = func(_llcppg_param1 *Object) *Object

llgo:type C

type Lenfunc

type Lenfunc = func(_llcppg_param1 *Object) SsizeT

llgo:type C

type ListObject added in v0.2.0

type ListObject struct {
	ObBase    VarObject
	ObItem    **Object
	Allocated SsizeT
}

func NewList added in v0.2.3

func NewList(size SsizeT) *ListObject

func (*ListObject) Append added in v0.2.3

func (self *ListObject) Append(_llcppg_param2 *Object) c.Int

llgo:link (*ListObject).Append C.PyList_Append

func (*ListObject) AsTuple added in v0.2.3

func (self *ListObject) AsTuple() *Object

llgo:link (*ListObject).AsTuple C.PyList_AsTuple

func (*ListObject) Clear added in v0.2.3

func (self *ListObject) Clear() c.Int

llgo:link (*ListObject).Clear C.PyList_Clear

func (*ListObject) Extend added in v0.2.3

func (self *ListObject) Extend(iterable *Object) c.Int

llgo:link (*ListObject).Extend C.PyList_Extend

func (*ListObject) Insert added in v0.2.3

func (self *ListObject) Insert(_llcppg_param2 SsizeT, _llcppg_param3 *Object) c.Int

llgo:link (*ListObject).Insert C.PyList_Insert

func (*ListObject) Item added in v0.2.3

func (self *ListObject) Item(_llcppg_param2 SsizeT) *Object

llgo:link (*ListObject).Item C.PyList_GetItem

func (*ListObject) ItemRef added in v0.2.3

func (self *ListObject) ItemRef(_llcppg_param2 SsizeT) *Object

llgo:link (*ListObject).ItemRef C.PyList_GetItemRef

func (*ListObject) Reverse added in v0.2.3

func (self *ListObject) Reverse() c.Int

llgo:link (*ListObject).Reverse C.PyList_Reverse

func (*ListObject) SetItem added in v0.2.3

func (self *ListObject) SetItem(_llcppg_param2 SsizeT, _llcppg_param3 *Object) c.Int

llgo:link (*ListObject).SetItem C.PyList_SetItem

func (*ListObject) SetSlice added in v0.2.3

func (self *ListObject) SetSlice(_llcppg_param2 SsizeT, _llcppg_param3 SsizeT, _llcppg_param4 *Object) c.Int

llgo:link (*ListObject).SetSlice C.PyList_SetSlice

func (*ListObject) Size added in v0.2.3

func (self *ListObject) Size() SsizeT

llgo:link (*ListObject).Size C.PyList_Size

func (*ListObject) Slice added in v0.2.3

func (self *ListObject) Slice(_llcppg_param2 SsizeT, _llcppg_param3 SsizeT) *Object

llgo:link (*ListObject).Slice C.PyList_GetSlice

func (*ListObject) Sort added in v0.2.3

func (self *ListObject) Sort() c.Int

llgo:link (*ListObject).Sort C.PyList_Sort

type LockStatus added in v0.2.0

type LockStatus c.Uint

Return status codes for Python lock acquisition. Chosen for maximum backwards compatibility, ie failure -> 0, success -> 1.

const (
	LOCK_FAILURE  LockStatus = 0
	LOCK_ACQUIRED LockStatus = 1
	LOCK_INTR     LockStatus = 2
)

func ThreadAcquireLockTimed added in v0.2.3

func ThreadAcquireLockTimed(_llcppg_param1 ThreadTypeLock, microseconds c.LongLong, intr_flag c.Int) LockStatus

If microseconds == 0, the call is non-blocking: it returns immediately even when the lock can't be acquired. If microseconds > 0, the call waits up to the specified duration. If microseconds < 0, the call waits until success (or abnormal failure)

If *microseconds* is greater than PY_TIMEOUT_MAX, clamp the timeout to PY_TIMEOUT_MAX microseconds.

If intr_flag is true and the acquire is interrupted by a signal, then the call will return PY_LOCK_INTR. The caller may reattempt to acquire the lock.

type LongExport added in v0.2.0

type LongExport struct {
	Value      c.Int64T
	Negative   c.Uint8T
	Ndigits    SsizeT
	Digits     unsafe.Pointer
	X_reserved UintptrT
}

func (*LongExport) LongFreeExport added in v0.2.3

func (self *LongExport) LongFreeExport()

llgo:link (*LongExport).LongFreeExport C.PyLong_FreeExport

type LongLayout added in v0.2.0

type LongLayout struct {
	BitsPerDigit    c.Uint8T
	DigitSize       c.Uint8T
	DigitsOrder     c.Int8T
	DigitEndianness c.Int8T
}

--- Import/Export API --------------------------------------------------

func LongGetNativeLayout added in v0.2.0

func LongGetNativeLayout() *LongLayout

type LongObject added in v0.2.0

type LongObject = X_longobject
var X_FalseStruct LongObject

Don't use these directly

var X_TrueStruct LongObject

func LongFromDouble added in v0.2.0

func LongFromDouble(_llcppg_param1 c.Double) *LongObject

func LongFromInt32 added in v0.2.0

func LongFromInt32(value c.Int32T) *LongObject

func LongFromInt64 added in v0.2.0

func LongFromInt64(value c.Int64T) *LongObject

func LongFromLong added in v0.2.0

func LongFromLong(_llcppg_param1 c.Long) *LongObject

func LongFromLongLong added in v0.2.0

func LongFromLongLong(_llcppg_param1 c.LongLong) *LongObject

func LongFromNativeBytes added in v0.2.0

func LongFromNativeBytes(buffer unsafe.Pointer, n_bytes c.SizeT, flags c.Int) *LongObject

PyLong_FromNativeBytes: Create an int value from a native integer n_bytes is the number of bytes to read from the buffer. Passing 0 will always produce the zero int. PyLong_FromUnsignedNativeBytes always produces a non-negative int. flags is the same as for PyLong_AsNativeBytes, but only supports selecting the endianness or forcing an unsigned buffer.

Returns the int object, or NULL with an exception set.

func LongFromSize_t added in v0.2.4

func LongFromSize_t(_llcppg_param1 c.SizeT) *LongObject

func LongFromSsize_t added in v0.2.4

func LongFromSsize_t(_llcppg_param1 SsizeT) *LongObject

func LongFromString added in v0.2.0

func LongFromString(_llcppg_param1 *c.Char, _llcppg_param2 **c.Char, _llcppg_param3 c.Int) *LongObject

func LongFromUInt32 added in v0.2.0

func LongFromUInt32(value c.Uint32T) *LongObject

func LongFromUInt64 added in v0.2.0

func LongFromUInt64(value c.Uint64T) *LongObject

func LongFromUnicodeObject added in v0.2.4

func LongFromUnicodeObject(u *Object, base c.Int) *LongObject

func LongFromUnsignedLong added in v0.2.0

func LongFromUnsignedLong(_llcppg_param1 c.Ulong) *LongObject

func LongFromUnsignedLongLong added in v0.2.0

func LongFromUnsignedLongLong(_llcppg_param1 c.UlongLong) *LongObject

func LongFromUnsignedNativeBytes added in v0.2.0

func LongFromUnsignedNativeBytes(buffer unsafe.Pointer, n_bytes c.SizeT, flags c.Int) *LongObject

func LongFromVoidPtr added in v0.2.0

func LongFromVoidPtr(_llcppg_param1 unsafe.Pointer) *LongObject

func X_LongFromDigits added in v0.2.0

func X_LongFromDigits(negative c.Int, digit_count SsizeT, digits *Digit) *LongObject

func X_LongNew added in v0.2.0

func X_LongNew(_llcppg_param1 SsizeT) *LongObject

func (*LongObject) As added in v0.2.3

func (self *LongObject) As() c.Long

llgo:link (*LongObject).As C.PyLong_AsLong

func (*LongObject) AsDouble added in v0.2.3

func (self *LongObject) AsDouble() c.Double

llgo:link (*LongObject).AsDouble C.PyLong_AsDouble

func (*LongObject) AsInt added in v0.2.3

func (self *LongObject) AsInt() c.Int

llgo:link (*LongObject).AsInt C.PyLong_AsInt

func (*LongObject) AsInt32 added in v0.2.3

func (self *LongObject) AsInt32(value *c.Int32T) c.Int

llgo:link (*LongObject).AsInt32 C.PyLong_AsInt32

func (*LongObject) AsInt64 added in v0.2.3

func (self *LongObject) AsInt64(value *c.Int64T) c.Int

llgo:link (*LongObject).AsInt64 C.PyLong_AsInt64

func (*LongObject) AsLong added in v0.2.3

func (self *LongObject) AsLong() c.LongLong

llgo:link (*LongObject).AsLong C.PyLong_AsLongLong

func (*LongObject) AsLongAndOverflow added in v0.2.3

func (self *LongObject) AsLongAndOverflow(_llcppg_param2 *c.Int) c.Long

llgo:link (*LongObject).AsLongAndOverflow C.PyLong_AsLongAndOverflow

func (*LongObject) AsLongLongAndOverflow added in v0.2.3

func (self *LongObject) AsLongLongAndOverflow(_llcppg_param2 *c.Int) c.LongLong

llgo:link (*LongObject).AsLongLongAndOverflow C.PyLong_AsLongLongAndOverflow

func (*LongObject) AsNativeBytes added in v0.2.3

func (self *LongObject) AsNativeBytes(buffer unsafe.Pointer, n_bytes SsizeT, flags c.Int) SsizeT

PyLong_AsNativeBytes: Copy the integer value to a native variable. buffer points to the first byte of the variable. n_bytes is the number of bytes available in the buffer. Pass 0 to request the required size for the value. flags is a bitfield of the following flags: 1 - little endian 2 - native endian 4 - unsigned destination (e.g. don't reject copying 255 into one byte) 8 - raise an exception for negative inputs 16 - call __index__ on non-int types If flags is -1 (all bits set), native endian is used, value truncation behaves most like C (allows negative inputs and allow MSB set), and non-int objects will raise a TypeError. Big endian mode will write the most significant byte into the address directly referenced by buffer; little endian will write the least significant byte into that address.

If an exception is raised, returns a negative value. Otherwise, returns the number of bytes that are required to store the value. To check that the full value is represented, ensure that the return value is equal or less than n_bytes. All n_bytes are guaranteed to be written (unless an exception occurs), and so ignoring a positive return value is the equivalent of a downcast in C. In cases where the full value could not be represented, the returned value may be larger than necessary - this function is not an accurate way to calculate the bit length of an integer object.

llgo:link (*LongObject).AsNativeBytes C.PyLong_AsNativeBytes

func (*LongObject) AsSizeT added in v0.2.3

func (self *LongObject) AsSizeT() c.SizeT

llgo:link (*LongObject).AsSizeT C.PyLong_AsSize_t

func (*LongObject) AsSsizeT added in v0.2.3

func (self *LongObject) AsSsizeT() SsizeT

llgo:link (*LongObject).AsSsizeT C.PyLong_AsSsize_t

func (*LongObject) AsUInt32 added in v0.2.3

func (self *LongObject) AsUInt32(value *c.Uint32T) c.Int

llgo:link (*LongObject).AsUInt32 C.PyLong_AsUInt32

func (*LongObject) AsUInt64 added in v0.2.3

func (self *LongObject) AsUInt64(value *c.Uint64T) c.Int

llgo:link (*LongObject).AsUInt64 C.PyLong_AsUInt64

func (*LongObject) AsUnsigned added in v0.2.3

func (self *LongObject) AsUnsigned() c.Ulong

llgo:link (*LongObject).AsUnsigned C.PyLong_AsUnsignedLong

func (*LongObject) AsUnsignedLong added in v0.2.3

func (self *LongObject) AsUnsignedLong() c.UlongLong

llgo:link (*LongObject).AsUnsignedLong C.PyLong_AsUnsignedLongLong

func (*LongObject) AsUnsignedLongLongMask added in v0.2.3

func (self *LongObject) AsUnsignedLongLongMask() c.UlongLong

llgo:link (*LongObject).AsUnsignedLongLongMask C.PyLong_AsUnsignedLongLongMask

func (*LongObject) AsUnsignedLongMask added in v0.2.3

func (self *LongObject) AsUnsignedLongMask() c.Ulong

llgo:link (*LongObject).AsUnsignedLongMask C.PyLong_AsUnsignedLongMask

func (*LongObject) AsVoidPtr added in v0.2.3

func (self *LongObject) AsVoidPtr() unsafe.Pointer

llgo:link (*LongObject).AsVoidPtr C.PyLong_AsVoidPtr

func (*LongObject) Export added in v0.2.3

func (self *LongObject) Export(export_long *LongExport) c.Int

llgo:link (*LongObject).Export C.PyLong_Export

func (*LongObject) IsNegative added in v0.2.3

func (self *LongObject) IsNegative() c.Int

PyLong_IsNegative. Check if the integer object is negative.

- On success, return 1 if *obj is negative, and 0 otherwise. - On failure, set an exception, and return -1.

llgo:link (*LongObject).IsNegative C.PyLong_IsNegative

func (*LongObject) IsPositive added in v0.2.3

func (self *LongObject) IsPositive() c.Int

PyLong_IsPositive. Check if the integer object is positive.

- On success, return 1 if *obj is positive, and 0 otherwise. - On failure, set an exception, and return -1.

llgo:link (*LongObject).IsPositive C.PyLong_IsPositive

func (*LongObject) IsZero added in v0.2.3

func (self *LongObject) IsZero() c.Int

PyLong_IsZero. Check if the integer object is zero.

- On success, return 1 if *obj is zero, and 0 if it is non-zero. - On failure, set an exception, and return -1.

llgo:link (*LongObject).IsZero C.PyLong_IsZero

func (*LongObject) Sign added in v0.2.3

func (self *LongObject) Sign(sign *c.Int) c.Int

PyLong_GetSign. Get the sign of an integer object: 0, -1 or +1 for zero, negative or positive integer, respectively.

- On success, set '*sign' to the integer sign, and return 0. - On failure, set an exception, and return -1.

llgo:link (*LongObject).Sign C.PyLong_GetSign

type LongWriter added in v0.2.0

type LongWriter struct {
}

func LongWriterCreate added in v0.2.0

func LongWriterCreate(negative c.Int, ndigits SsizeT, digits *unsafe.Pointer) *LongWriter

type MappingMethods added in v0.2.0

type MappingMethods struct {
	MpLength       Lenfunc
	MpSubscript    Binaryfunc
	MpAssSubscript Objobjargproc
}

type MemAllocatorDomain added in v0.2.0

type MemAllocatorDomain c.Uint
const (
	// PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree()
	PYMEM_DOMAIN_RAW MemAllocatorDomain = 0
	// PyMem_Malloc(), PyMem_Realloc() and PyMem_Free()
	PYMEM_DOMAIN_MEM MemAllocatorDomain = 1
	// PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()
	PYMEM_DOMAIN_OBJ MemAllocatorDomain = 2
)

type MemAllocatorEx added in v0.2.0

type MemAllocatorEx struct {
	Ctx     unsafe.Pointer
	Malloc  func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.SizeT) unsafe.Pointer
	Calloc  func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.SizeT, _llcppg_param3 c.SizeT) unsafe.Pointer
	Realloc func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 unsafe.Pointer, _llcppg_param3 c.SizeT) unsafe.Pointer
	Free    func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 unsafe.Pointer)
}

llgo:type C

type MemAllocatorName added in v0.2.0

type MemAllocatorName c.Uint
const (
	PYMEM_ALLOCATOR_NOT_SET        MemAllocatorName = 0
	PYMEM_ALLOCATOR_DEFAULT        MemAllocatorName = 1
	PYMEM_ALLOCATOR_DEBUG          MemAllocatorName = 2
	PYMEM_ALLOCATOR_MALLOC         MemAllocatorName = 3
	PYMEM_ALLOCATOR_MALLOC_DEBUG   MemAllocatorName = 4
	PYMEM_ALLOCATOR_PYMALLOC       MemAllocatorName = 5
	PYMEM_ALLOCATOR_PYMALLOC_DEBUG MemAllocatorName = 6
	PYMEM_ALLOCATOR_MIMALLOC       MemAllocatorName = 7
	PYMEM_ALLOCATOR_MIMALLOC_DEBUG MemAllocatorName = 8
)

type MemberDef added in v0.2.0

type MemberDef struct {
	Name   *c.Char
	Type   c.Int
	Offset SsizeT
	Flags  c.Int
	Doc    *c.Char
}

An array of PyMemberDef structures defines the name, type and offset of selected members of a C structure. These can be read by PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY flag is set). The array must be terminated with an entry whose name pointer is NULL.

type MemberDescrObject added in v0.2.0

type MemberDescrObject struct {
	DCommon DescrObject
	DMember *MemberDef
}

type MemoryViewObject added in v0.2.0

type MemoryViewObject struct {
	ObBase      VarObject
	Mbuf        *X_ManagedBufferObject
	Hash        HashT
	Flags       c.Int
	Exports     SsizeT
	View        Buffer
	Weakreflist *Object
	ObArray     [1]SsizeT
}

func MemoryViewFromBuffer added in v0.2.4

func MemoryViewFromBuffer(info *Buffer) *MemoryViewObject

func MemoryViewFromMemory added in v0.2.0

func MemoryViewFromMemory(mem *c.Char, size SsizeT, flags c.Int) *MemoryViewObject

func (*MemoryViewObject) Contiguous added in v0.2.3

func (self *MemoryViewObject) Contiguous(buffertype c.Int, order c.Char) *Object

llgo:link (*MemoryViewObject).Contiguous C.PyMemoryView_GetContiguous

type MethodDef added in v0.2.0

type MethodDef struct {
	MlName  *c.Char
	MlMeth  CFunction
	MlFlags c.Int
	MlDoc   *c.Char
}

func (*MethodDef) CFunctionNewEx added in v0.2.0

func (self *MethodDef) CFunctionNewEx(_llcppg_param2 *Object, _llcppg_param3 *Object) *Object

PyCFunction_NewEx is similar: on 3.9+, this calls PyCMethod_New.

llgo:link (*MethodDef).CFunctionNewEx C.PyCFunction_NewEx

type MethodDescrObject added in v0.2.0

type MethodDescrObject struct {
	DCommon    DescrObject
	DMethod    *MethodDef
	Vectorcall Vectorcallfunc
}

type MethodObject added in v0.2.0

type MethodObject struct {
	ObBase        Object
	ImFunc        *Object
	ImSelf        *Object
	ImWeakreflist *Object
	Vectorcall    Vectorcallfunc
}

func NewMethod added in v0.2.3

func NewMethod(_llcppg_param1 *Object, _llcppg_param2 *Object) *MethodObject

func (*MethodObject) Function added in v0.2.3

func (self *MethodObject) Function() *Object

llgo:link (*MethodObject).Function C.PyMethod_Function

func (*MethodObject) Self added in v0.2.3

func (self *MethodObject) Self() *Object

llgo:link (*MethodObject).Self C.PyMethod_Self

type ModuleDef added in v0.2.0

type ModuleDef struct {
	MBase     ModuleDefBase
	MName     *c.Char
	MDoc      *c.Char
	MSize     SsizeT
	MMethods  *MethodDef
	MSlots    *ModuleDefSlot
	MTraverse Traverseproc
	MClear    Inquiry
	MFree     Freefunc
}

func ModuleGetDef added in v0.2.3

func ModuleGetDef(_llcppg_param1 *Object) *ModuleDef

type ModuleDefBase added in v0.2.0

type ModuleDefBase struct {
	ObBase Object
	MInit  func() *Object
	MIndex SsizeT
	MCopy  *Object
}

llgo:type C

type ModuleDefSlot added in v0.2.0

type ModuleDefSlot struct {
	Slot  c.Int
	Value unsafe.Pointer
}

New in 3.5

type MonitoringState added in v0.2.0

type MonitoringState = X_MonitoringState

type Mutex added in v0.2.0

type Mutex struct {
	X_bits c.Uint8T
}

A mutex that occupies one byte. The lock can be zero initialized to represent the unlocked state.

Typical initialization:

PyMutex m = (PyMutex){0};

Or initialize as global variables:

static PyMutex m;

Typical usage:

PyMutex_Lock(&m);
...
PyMutex_Unlock(&m);

The contents of the PyMutex are not part of the public API, but are described to aid in understanding the implementation and debugging. Only the two least significant bits are used. The remaining bits are always zero: 0b00: unlocked 0b01: locked 0b10: unlocked and has parked threads 0b11: locked and has parked threads

type NameErrorObject added in v0.2.0

type NameErrorObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Name            *Object
}

type Newfunc

type Newfunc = func(_llcppg_param1 *TypeObject, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

llgo:type C

type NumberMethods added in v0.2.0

type NumberMethods struct {
	NbAdd                   Binaryfunc
	NbSubtract              Binaryfunc
	NbMultiply              Binaryfunc
	NbRemainder             Binaryfunc
	NbDivmod                Binaryfunc
	NbPower                 Ternaryfunc
	NbNegative              Unaryfunc
	NbPositive              Unaryfunc
	NbAbsolute              Unaryfunc
	NbBool                  Inquiry
	NbInvert                Unaryfunc
	NbLshift                Binaryfunc
	NbRshift                Binaryfunc
	NbAnd                   Binaryfunc
	NbXor                   Binaryfunc
	NbOr                    Binaryfunc
	NbInt                   Unaryfunc
	NbReserved              unsafe.Pointer
	NbFloat                 Unaryfunc
	NbInplaceAdd            Binaryfunc
	NbInplaceSubtract       Binaryfunc
	NbInplaceMultiply       Binaryfunc
	NbInplaceRemainder      Binaryfunc
	NbInplacePower          Ternaryfunc
	NbInplaceLshift         Binaryfunc
	NbInplaceRshift         Binaryfunc
	NbInplaceAnd            Binaryfunc
	NbInplaceXor            Binaryfunc
	NbInplaceOr             Binaryfunc
	NbFloorDivide           Binaryfunc
	NbTrueDivide            Binaryfunc
	NbInplaceFloorDivide    Binaryfunc
	NbInplaceTrueDivide     Binaryfunc
	NbIndex                 Unaryfunc
	NbMatrixMultiply        Binaryfunc
	NbInplaceMatrixMultiply Binaryfunc
}

type ODictObject added in v0.2.0

type ODictObject = X_odictobject

type OSErrorObject added in v0.2.0

type OSErrorObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Myerrno         *Object
	Strerror        *Object
	Filename        *Object
	Filename2       *Object
	Written         SsizeT
}

type OSSighandlerT added in v0.2.0

type OSSighandlerT = func(_llcppg_param1 c.Int)

Signals

llgo:type C

func OSGetsig added in v0.2.0

func OSGetsig(_llcppg_param1 c.Int) OSSighandlerT

func OSSetsig added in v0.2.0

func OSSetsig(_llcppg_param1 c.Int, _llcppg_param2 OSSighandlerT) OSSighandlerT

type Object added in v0.2.0

type Object = X_object
var ExcArithmeticError *Object
var ExcAssertionError *Object
var ExcAttributeError *Object
var ExcBaseException *Object

Predefined exceptions

var ExcBaseExceptionGroup *Object
var ExcBlockingIOError *Object
var ExcBrokenPipeError *Object
var ExcBufferError *Object
var ExcBytesWarning *Object
var ExcChildProcessError *Object
var ExcConnectionAbortedError *Object
var ExcConnectionError *Object
var ExcConnectionRefusedError *Object
var ExcConnectionResetError *Object
var ExcDeprecationWarning *Object
var ExcEOFError *Object
var ExcEncodingWarning *Object
var ExcEnvironmentError *Object

Compatibility aliases

var ExcException *Object
var ExcFileExistsError *Object
var ExcFileNotFoundError *Object
var ExcFloatingPointError *Object
var ExcFutureWarning *Object
var ExcGeneratorExit *Object
var ExcIOError *Object
var ExcImportError *Object
var ExcImportWarning *Object
var ExcIndentationError *Object
var ExcIndexError *Object
var ExcInterruptedError *Object
var ExcIsADirectoryError *Object
var ExcKeyError *Object
var ExcKeyboardInterrupt *Object
var ExcLookupError *Object
var ExcMemoryError *Object
var ExcModuleNotFoundError *Object
var ExcNameError *Object
var ExcNotADirectoryError *Object
var ExcNotImplementedError *Object
var ExcOSError *Object
var ExcOverflowError *Object
var ExcPendingDeprecationWarning *Object
var ExcPermissionError *Object
var ExcProcessLookupError *Object
var ExcPythonFinalizationError *Object
var ExcRecursionError *Object
var ExcReferenceError *Object
var ExcResourceWarning *Object
var ExcRuntimeError *Object
var ExcRuntimeWarning *Object
var ExcStopAsyncIteration *Object
var ExcStopIteration *Object
var ExcSyntaxError *Object
var ExcSyntaxWarning *Object
var ExcSystemError *Object
var ExcSystemExit *Object
var ExcTabError *Object
var ExcTimeoutError *Object
var ExcTypeError *Object
var ExcUnboundLocalError *Object
var ExcUnicodeDecodeError *Object
var ExcUnicodeEncodeError *Object
var ExcUnicodeError *Object
var ExcUnicodeTranslateError *Object
var ExcUnicodeWarning *Object
var ExcUserWarning *Object
var ExcValueError *Object
var ExcWarning *Object

Predefined warning categories

var ExcZeroDivisionError *Object
var X_EllipsisObject Object

Don't use this directly

var X_NoneStruct Object

Don't use this directly

var X_NotImplementedStruct Object

Don't use this directly

func AsyncGenNew added in v0.2.1

func AsyncGenNew(_llcppg_param1 *FrameObject, name *Object, qualname *Object) *Object

func BoolFromLong added in v0.2.0

func BoolFromLong(_llcppg_param1 c.Long) *Object

Function to return a bool from a C long

func BuildValue added in v0.2.0

func BuildValue(_llcppg_param1 *c.Char, __llgo_va_list ...any) *Object

func BytesDecodeEscape added in v0.2.0

func BytesDecodeEscape(_llcppg_param1 *c.Char, _llcppg_param2 SsizeT, _llcppg_param3 *c.Char, _llcppg_param4 SsizeT, _llcppg_param5 *c.Char) *Object

func CallIterNew added in v0.2.3

func CallIterNew(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

func CapsuleNew added in v0.2.0

func CapsuleNew(pointer unsafe.Pointer, name *c.Char, destructor CapsuleDestructor) *Object

func ClassMethodNew added in v0.2.3

func ClassMethodNew(_llcppg_param1 *Object) *Object

func CodecBackslashReplaceErrors added in v0.2.3

func CodecBackslashReplaceErrors(exc *Object) *Object

replace the unicode encode error with backslash escapes (\x, \u and \U)

func CodecDecode added in v0.2.3

func CodecDecode(object *Object, encoding *c.Char, errors *c.Char) *Object

Generic codec based decoding API.

object is passed through the decoder function found for the given encoding using the error handling method defined by errors. errors may be NULL to use the default method defined for the codec.

Raises a LookupError in case no encoder can be found.

func CodecDecoder added in v0.2.0

func CodecDecoder(encoding *c.Char) *Object

Get a decoder function for the given encoding.

func CodecEncode added in v0.2.3

func CodecEncode(object *Object, encoding *c.Char, errors *c.Char) *Object

Generic codec based encoding API.

object is passed through the encoder function found for the given encoding using the error handling method defined by errors. errors may be NULL to use the default method defined for the codec.

Raises a LookupError in case no encoder can be found.

func CodecEncoder added in v0.2.0

func CodecEncoder(encoding *c.Char) *Object

Get an encoder function for the given encoding.

func CodecIgnoreErrors added in v0.2.3

func CodecIgnoreErrors(exc *Object) *Object

ignore the unicode error, skipping the faulty input

func CodecIncrementalDecoder added in v0.2.0

func CodecIncrementalDecoder(encoding *c.Char, errors *c.Char) *Object

Get an IncrementalDecoder object function for the given encoding.

func CodecIncrementalEncoder added in v0.2.0

func CodecIncrementalEncoder(encoding *c.Char, errors *c.Char) *Object

Get an IncrementalEncoder object for the given encoding.

func CodecLookupError added in v0.2.0

func CodecLookupError(name *c.Char) *Object

Lookup the error handling callback function registered under the given name. As a special case NULL can be passed, in which case the error handling callback for "strict" will be returned.

func CodecNameReplaceErrors added in v0.2.3

func CodecNameReplaceErrors(exc *Object) *Object

replace the unicode encode error with backslash escapes (\N, \x, \u and \U)

func CodecReplaceErrors added in v0.2.3

func CodecReplaceErrors(exc *Object) *Object

replace the unicode encode error with ? or U+FFFD

func CodecStreamReader added in v0.2.0

func CodecStreamReader(encoding *c.Char, stream *Object, errors *c.Char) *Object

Get a StreamReader factory function for the given encoding.

func CodecStreamWriter added in v0.2.0

func CodecStreamWriter(encoding *c.Char, stream *Object, errors *c.Char) *Object

Get a StreamWriter factory function for the given encoding.

func CodecStrictErrors added in v0.2.3

func CodecStrictErrors(exc *Object) *Object

raise exc as an exception

func CodecXMLCharRefReplaceErrors added in v0.2.3

func CodecXMLCharRefReplaceErrors(exc *Object) *Object

replace the unicode encode error with XML character references

func CompileString added in v0.2.0

func CompileString(_llcppg_param1 *c.Char, _llcppg_param2 *c.Char, _llcppg_param3 c.Int) *Object

func CompileStringExFlags added in v0.2.0

func CompileStringExFlags(str *c.Char, filename *c.Char, start c.Int, flags *CompilerFlags, optimize c.Int) *Object

func CompileStringFlags added in v0.2.0

func CompileStringFlags(str *c.Char, filename *c.Char, start c.Int, flags *CompilerFlags) *Object

func CompileStringObject added in v0.2.0

func CompileStringObject(str *c.Char, filename *Object, start c.Int, flags *CompilerFlags, optimize c.Int) *Object

func ConfigGet added in v0.2.0

func ConfigGet(name *c.Char) *Object

--- PyConfig_Get() -----------------------------------------

func ConfigNames added in v0.2.0

func ConfigNames() *Object

func ContextCopy added in v0.2.3

func ContextCopy(_llcppg_param1 *Object) *Object

func ContextCopyCurrent added in v0.2.0

func ContextCopyCurrent() *Object

func ContextNew added in v0.2.0

func ContextNew() *Object

func ContextVarNew added in v0.2.0

func ContextVarNew(name *c.Char, default_value *Object) *Object

Create a new context variable.

default_value can be NULL.

func ContextVarSet added in v0.2.3

func ContextVarSet(var_ *Object, value *Object) *Object

Set a new value for the variable. Returns NULL if an error occurs.

func CoroNew added in v0.2.1

func CoroNew(_llcppg_param1 *FrameObject, name *Object, qualname *Object) *Object

func DictProxyNew added in v0.2.3

func DictProxyNew(_llcppg_param1 *Object) *Object

func ErrFormat added in v0.2.1

func ErrFormat(exception *Object, format *c.Char, __llgo_va_list ...any) *Object

func ErrGetHandledException added in v0.2.0

func ErrGetHandledException() *Object

func ErrGetRaisedException added in v0.2.0

func ErrGetRaisedException() *Object

func ErrNewException added in v0.2.0

func ErrNewException(name *c.Char, base *Object, dict *Object) *Object

Function to create a new exception

func ErrNewExceptionWithDoc added in v0.2.0

func ErrNewExceptionWithDoc(name *c.Char, doc *c.Char, base *Object, dict *Object) *Object

func ErrNoMemory added in v0.2.0

func ErrNoMemory() *Object

func ErrOccurred added in v0.2.0

func ErrOccurred() *Object

func ErrProgramText added in v0.2.0

func ErrProgramText(filename *c.Char, lineno c.Int) *Object

func ErrProgramTextObject added in v0.2.1

func ErrProgramTextObject(filename *Object, lineno c.Int) *Object

func ErrSetFromErrno added in v0.2.1

func ErrSetFromErrno(_llcppg_param1 *Object) *Object

func ErrSetFromErrnoWithFilename added in v0.2.1

func ErrSetFromErrnoWithFilename(exc *Object, filename *c.Char) *Object

func ErrSetFromErrnoWithFilenameObject added in v0.2.1

func ErrSetFromErrnoWithFilenameObject(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

func ErrSetFromErrnoWithFilenameObjects added in v0.2.1

func ErrSetFromErrnoWithFilenameObjects(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

func ErrSetImportError added in v0.2.1

func ErrSetImportError(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

func ErrSetImportErrorSubclass added in v0.2.1

func ErrSetImportErrorSubclass(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object, _llcppg_param4 *Object) *Object

func Err_FormatV added in v0.2.1

func Err_FormatV(exception *Object, format *c.Char, vargs c.VaList) *Object

func EvalCode added in v0.2.1

func EvalCode(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

func EvalCodeEx added in v0.2.1

func EvalCodeEx(co *Object, globals *Object, locals *Object, args **Object, argc c.Int, kwds **Object, kwdc c.Int, defs **Object, defc c.Int, kwdefs *Object, closure *Object) *Object

func EvalFrame added in v0.2.1

func EvalFrame(_llcppg_param1 *FrameObject) *Object

func EvalFrameEx added in v0.2.1

func EvalFrameEx(f *FrameObject, exc c.Int) *Object

func EvalGetBuiltins added in v0.2.0

func EvalGetBuiltins() *Object

func EvalGetFrameBuiltins added in v0.2.0

func EvalGetFrameBuiltins() *Object

func EvalGetFrameGlobals added in v0.2.0

func EvalGetFrameGlobals() *Object

func EvalGetFrameLocals added in v0.2.0

func EvalGetFrameLocals() *Object

func EvalGetGlobals added in v0.2.0

func EvalGetGlobals() *Object

func EvalGetLocals added in v0.2.0

func EvalGetLocals() *Object

func ExceptionGetArgs added in v0.2.3

func ExceptionGetArgs(_llcppg_param1 *Object) *Object

func ExceptionGetCause added in v0.2.3

func ExceptionGetCause(_llcppg_param1 *Object) *Object

Cause manipulation (PEP 3134)

func ExceptionGetContext added in v0.2.3

func ExceptionGetContext(_llcppg_param1 *Object) *Object

Context manipulation (PEP 3134)

func ExceptionGetTraceback added in v0.2.3

func ExceptionGetTraceback(_llcppg_param1 *Object) *Object

func FileFromFd added in v0.2.0

func FileFromFd(_llcppg_param1 c.Int, _llcppg_param2 *c.Char, _llcppg_param3 *c.Char, _llcppg_param4 c.Int, _llcppg_param5 *c.Char, _llcppg_param6 *c.Char, _llcppg_param7 *c.Char, _llcppg_param8 c.Int) *Object

func FileGetLine added in v0.2.3

func FileGetLine(_llcppg_param1 *Object, _llcppg_param2 c.Int) *Object

func FileNewStdPrinter added in v0.2.0

func FileNewStdPrinter(_llcppg_param1 c.Int) *Object

The std printer acts as a preliminary sys.stderr until the new io infrastructure is in place.

func FileOpenCode added in v0.2.0

func FileOpenCode(utf8path *c.Char) *Object

func FileOpenCodeObject added in v0.2.3

func FileOpenCodeObject(path *Object) *Object

func FloatGetInfo added in v0.2.0

func FloatGetInfo() *Object

func FrozenSetNew added in v0.2.3

func FrozenSetNew(_llcppg_param1 *Object) *Object

func GenNew added in v0.2.1

func GenNew(_llcppg_param1 *FrameObject) *Object

func GenericAlias added in v0.2.0

func GenericAlias(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

func GetConstant added in v0.2.0

func GetConstant(constant_id c.Uint) *Object

func GetConstantBorrowed added in v0.2.0

func GetConstantBorrowed(constant_id c.Uint) *Object

func Import added in v0.2.0

func Import(name *Object) *Object

func ImportAddModule added in v0.2.0

func ImportAddModule(name *c.Char) *Object

func ImportAddModuleObject added in v0.2.0

func ImportAddModuleObject(name *Object) *Object

func ImportAddModuleRef added in v0.2.0

func ImportAddModuleRef(name *c.Char) *Object

func ImportExecCodeModule added in v0.2.0

func ImportExecCodeModule(name *c.Char, co *Object) *Object

func ImportExecCodeModuleEx added in v0.2.0

func ImportExecCodeModuleEx(name *c.Char, co *Object, pathname *c.Char) *Object

func ImportExecCodeModuleObject added in v0.2.0

func ImportExecCodeModuleObject(name *Object, co *Object, pathname *Object, cpathname *Object) *Object

func ImportExecCodeModuleWithPathnames added in v0.2.0

func ImportExecCodeModuleWithPathnames(name *c.Char, co *Object, pathname *c.Char, cpathname *c.Char) *Object

func ImportGetImporter added in v0.2.0

func ImportGetImporter(path *Object) *Object

func ImportGetModule added in v0.2.0

func ImportGetModule(name *Object) *Object

func ImportGetModuleDict added in v0.2.0

func ImportGetModuleDict() *Object

func ImportImportModule added in v0.2.0

func ImportImportModule(name *c.Char) *Object

func ImportImportModuleAttr added in v0.2.0

func ImportImportModuleAttr(mod_name *Object, attr_name *Object) *Object

func ImportImportModuleAttrString added in v0.2.0

func ImportImportModuleAttrString(mod_name *c.Char, attr_name *c.Char) *Object

func ImportImportModuleLevel added in v0.2.0

func ImportImportModuleLevel(name *c.Char, globals *Object, locals *Object, fromlist *Object, level c.Int) *Object

func ImportImportModuleLevelObject added in v0.2.0

func ImportImportModuleLevelObject(name *Object, globals *Object, locals *Object, fromlist *Object, level c.Int) *Object

func ImportImportModuleNoBlock added in v0.2.0

func ImportImportModuleNoBlock(name *c.Char) *Object

func ImportReloadModule added in v0.2.0

func ImportReloadModule(m *Object) *Object

func InterpreterStateGetDict added in v0.2.3

func InterpreterStateGetDict(_llcppg_param1 *InterpreterState) *Object

New in 3.8

func IterNext added in v0.2.3

func IterNext(_llcppg_param1 *Object) *Object

Takes an iterator object and calls its tp_iternext slot, returning the next value.

If the iterator is exhausted, this returns NULL without setting an exception.

NULL with an exception means an error occurred.

Prefer PyIter_NextItem() instead.

func LongGetInfo added in v0.2.0

func LongGetInfo() *Object

func LongWriterFinish added in v0.2.3

func LongWriterFinish(writer *LongWriter) *Object

func MappingGetItemString added in v0.2.3

func MappingGetItemString(o *Object, key *c.Char) *Object

Return element of 'o' corresponding to the string 'key' or NULL on failure.

This is the equivalent of the Python expression: o[key].

func MappingItems added in v0.2.3

func MappingItems(o *Object) *Object

On success, return a list of the items in mapping object 'o', where each item is a tuple containing a key-value pair. On failure, return NULL.

func MappingKeys added in v0.2.3

func MappingKeys(o *Object) *Object

On success, return a list of the keys in mapping object 'o'. On failure, return NULL.

func MappingValues added in v0.2.3

func MappingValues(o *Object) *Object

On success, return a list of the values in mapping object 'o'. On failure, return NULL.

func MemberGetOne added in v0.2.0

func MemberGetOne(_llcppg_param1 *c.Char, _llcppg_param2 *MemberDef) *Object

func ModuleCreate2 added in v0.2.3

func ModuleCreate2(_llcppg_param1 *ModuleDef, apiver c.Int) *Object

func ModuleDefInit added in v0.2.3

func ModuleDefInit(_llcppg_param1 *ModuleDef) *Object

New in 3.5

func ModuleFromDefAndSpec2 added in v0.2.3

func ModuleFromDefAndSpec2(def *ModuleDef, spec *Object, module_api_version c.Int) *Object

New in 3.5

func ModuleGetDict added in v0.2.3

func ModuleGetDict(_llcppg_param1 *Object) *Object

func ModuleGetFilenameObject added in v0.2.3

func ModuleGetFilenameObject(_llcppg_param1 *Object) *Object

func ModuleGetNameObject added in v0.2.3

func ModuleGetNameObject(_llcppg_param1 *Object) *Object

func ModuleNew added in v0.2.0

func ModuleNew(name *c.Char) *Object

func ModuleNewObject added in v0.2.3

func ModuleNewObject(name *Object) *Object

func NewRef added in v0.2.0

func NewRef(obj *Object) *Object

Create a new strong reference to an object: increment the reference count of the object and return the object.

func NumberAbsolute added in v0.2.3

func NumberAbsolute(o *Object) *Object

Returns the absolute value of 'o', or NULL on failure.

This is the equivalent of the Python expression: abs(o).

func NumberAdd added in v0.2.3

func NumberAdd(o1 *Object, o2 *Object) *Object

Returns the result of adding o1 and o2, or NULL on failure.

This is the equivalent of the Python expression: o1 + o2.

func NumberAnd added in v0.2.3

func NumberAnd(o1 *Object, o2 *Object) *Object

Returns the result of bitwise and of o1 and o2 on success, or NULL on failure.

This is the equivalent of the Python expression: o1 & o2.

func NumberDivmod added in v0.2.3

func NumberDivmod(o1 *Object, o2 *Object) *Object

See the built-in function divmod.

Returns NULL on failure.

This is the equivalent of the Python expression: divmod(o1, o2).

func NumberFloat added in v0.2.3

func NumberFloat(o *Object) *Object

Returns the object 'o' converted to a float object on success, or NULL on failure.

This is the equivalent of the Python expression: float(o).

func NumberFloorDivide added in v0.2.3

func NumberFloorDivide(o1 *Object, o2 *Object) *Object

Returns the result of dividing o1 by o2 giving an integral result, or NULL on failure.

This is the equivalent of the Python expression: o1 // o2.

func NumberInPlaceAdd added in v0.2.3

func NumberInPlaceAdd(o1 *Object, o2 *Object) *Object

Returns the result of adding o2 to o1, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 += o2.

func NumberInPlaceAnd added in v0.2.3

func NumberInPlaceAnd(o1 *Object, o2 *Object) *Object

Returns the result of bitwise and of o1 and o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 &= o2.

func NumberInPlaceFloorDivide added in v0.2.3

func NumberInPlaceFloorDivide(o1 *Object, o2 *Object) *Object

Returns the result of dividing o1 by o2 giving an integral result, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 /= o2.

func NumberInPlaceLshift added in v0.2.3

func NumberInPlaceLshift(o1 *Object, o2 *Object) *Object

Returns the result of left shifting o1 by o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 <<= o2.

func NumberInPlaceMatrixMultiply added in v0.2.3

func NumberInPlaceMatrixMultiply(o1 *Object, o2 *Object) *Object

This is the equivalent of the Python expression: o1 @= o2.

func NumberInPlaceMultiply added in v0.2.3

func NumberInPlaceMultiply(o1 *Object, o2 *Object) *Object

Returns the result of multiplying o1 by o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 *= o2.

func NumberInPlaceOr added in v0.2.3

func NumberInPlaceOr(o1 *Object, o2 *Object) *Object

Returns the result of bitwise or of o1 and o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 |= o2.

func NumberInPlacePower added in v0.2.3

func NumberInPlacePower(o1 *Object, o2 *Object, o3 *Object) *Object

Returns the result of raising o1 to the power of o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 **= o2, or o1 = pow(o1, o2, o3) if o3 is present.

func NumberInPlaceRemainder added in v0.2.3

func NumberInPlaceRemainder(o1 *Object, o2 *Object) *Object

Returns the remainder of dividing o1 by o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 %= o2.

func NumberInPlaceRshift added in v0.2.3

func NumberInPlaceRshift(o1 *Object, o2 *Object) *Object

Returns the result of right shifting o1 by o2, possibly in-place or NULL on failure.

This is the equivalent of the Python expression: o1 >>= o2.

func NumberInPlaceSubtract added in v0.2.3

func NumberInPlaceSubtract(o1 *Object, o2 *Object) *Object

Returns the result of subtracting o2 from o1, possibly in-place or NULL on failure.

This is the equivalent of the Python expression: o1 -= o2.

func NumberInPlaceTrueDivide added in v0.2.3

func NumberInPlaceTrueDivide(o1 *Object, o2 *Object) *Object

Returns the result of dividing o1 by o2 giving a float result, possibly in-place, or null on failure.

This is the equivalent of the Python expression: o1 /= o2.

func NumberInPlaceXor added in v0.2.3

func NumberInPlaceXor(o1 *Object, o2 *Object) *Object

Returns the bitwise exclusive or of o1 by o2, possibly in-place, or NULL on failure.

This is the equivalent of the Python expression: o1 ^= o2.

func NumberIndex added in v0.2.3

func NumberIndex(o *Object) *Object

Returns the object 'o' converted to a Python int, or NULL with an exception raised on failure.

func NumberInvert added in v0.2.3

func NumberInvert(o *Object) *Object

Returns the bitwise negation of 'o' on success, or NULL on failure.

This is the equivalent of the Python expression: ~o.

func NumberLong added in v0.2.3

func NumberLong(o *Object) *Object

Returns the object 'o' converted to an integer object on success, or NULL on failure.

This is the equivalent of the Python expression: int(o).

func NumberLshift added in v0.2.3

func NumberLshift(o1 *Object, o2 *Object) *Object

Returns the result of left shifting o1 by o2 on success, or NULL on failure.

This is the equivalent of the Python expression: o1 << o2.

func NumberMatrixMultiply added in v0.2.3

func NumberMatrixMultiply(o1 *Object, o2 *Object) *Object

This is the equivalent of the Python expression: o1 @ o2.

func NumberMultiply added in v0.2.3

func NumberMultiply(o1 *Object, o2 *Object) *Object

Returns the result of multiplying o1 and o2, or NULL on failure.

This is the equivalent of the Python expression: o1 * o2.

func NumberNegative added in v0.2.3

func NumberNegative(o *Object) *Object

Returns the negation of o on success, or NULL on failure.

This is the equivalent of the Python expression: -o.

func NumberOr added in v0.2.3

func NumberOr(o1 *Object, o2 *Object) *Object

Returns the result of bitwise or on o1 and o2 on success, or NULL on failure.

This is the equivalent of the Python expression: o1 | o2.

func NumberPositive added in v0.2.3

func NumberPositive(o *Object) *Object

Returns the positive of o on success, or NULL on failure.

This is the equivalent of the Python expression: +o.

func NumberPower added in v0.2.3

func NumberPower(o1 *Object, o2 *Object, o3 *Object) *Object

See the built-in function pow. Returns NULL on failure.

This is the equivalent of the Python expression: pow(o1, o2, o3), where o3 is optional.

func NumberRemainder added in v0.2.3

func NumberRemainder(o1 *Object, o2 *Object) *Object

Returns the remainder of dividing o1 by o2, or NULL on failure.

This is the equivalent of the Python expression: o1 % o2.

func NumberRshift added in v0.2.3

func NumberRshift(o1 *Object, o2 *Object) *Object

Returns the result of right shifting o1 by o2 on success, or NULL on failure.

This is the equivalent of the Python expression: o1 >> o2.

func NumberSubtract added in v0.2.3

func NumberSubtract(o1 *Object, o2 *Object) *Object

Returns the result of subtracting o2 from o1, or NULL on failure.

This is the equivalent of the Python expression: o1 - o2.

func NumberToBase added in v0.2.3

func NumberToBase(n *Object, base c.Int) *Object

Returns the integer n converted to a string with a base, with a base marker of 0b, 0o or 0x prefixed if applicable.

If n is not an int object, it is converted with PyNumber_Index first.

func NumberTrueDivide added in v0.2.3

func NumberTrueDivide(o1 *Object, o2 *Object) *Object

Returns the result of dividing o1 by o2 giving a float result, or NULL on failure.

This is the equivalent of the Python expression: o1 / o2.

func NumberXor added in v0.2.3

func NumberXor(o1 *Object, o2 *Object) *Object

Returns the bitwise exclusive or of o1 by o2 on success, or NULL on failure.

This is the equivalent of the Python expression: o1 ^ o2.

func ODictNew added in v0.2.0

func ODictNew() *Object

func OS_FSPath added in v0.2.3

func OS_FSPath(path *Object) *Object

func PickleBufferFromObject added in v0.2.3

func PickleBufferFromObject(_llcppg_param1 *Object) *Object

Create a PickleBuffer redirecting to the given buffer-enabled object

func RunFile added in v0.2.0

func RunFile(fp *c.FILE, p *c.Char, s c.Int, g *Object, l *Object) *Object

func RunFileEx added in v0.2.0

func RunFileEx(fp *c.FILE, p *c.Char, s c.Int, g *Object, l *Object, c c.Int) *Object

func RunFileExFlags added in v0.2.0

func RunFileExFlags(fp *c.FILE, filename *c.Char, start c.Int, globals *Object, locals *Object, closeit c.Int, flags *CompilerFlags) *Object

func RunFileFlags added in v0.2.0

func RunFileFlags(fp *c.FILE, p *c.Char, s c.Int, g *Object, l *Object, flags *CompilerFlags) *Object

func RunString added in v0.2.0

func RunString(str *c.Char, s c.Int, g *Object, l *Object) *Object

A function flavor is also exported by libpython. It is required when libpython is accessed directly rather than using header files which defines macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to export functions in pythonXX.dll.

func RunStringFlags added in v0.2.0

func RunStringFlags(_llcppg_param1 *c.Char, _llcppg_param2 c.Int, _llcppg_param3 *Object, _llcppg_param4 *Object, _llcppg_param5 *CompilerFlags) *Object

func SeqIterNew added in v0.2.3

func SeqIterNew(_llcppg_param1 *Object) *Object

func SequenceConcat added in v0.2.3

func SequenceConcat(o1 *Object, o2 *Object) *Object

Return the concatenation of o1 and o2 on success, and NULL on failure.

This is the equivalent of the Python expression: o1 + o2.

func SequenceFast added in v0.2.3

func SequenceFast(o *Object, m *c.Char) *Object

Return the sequence 'o' as a list, unless it's already a tuple or list.

Use PySequence_Fast_GET_ITEM to access the members of this list, and PySequence_Fast_GET_SIZE to get its length.

Returns NULL on failure. If the object does not support iteration, raises a TypeError exception with 'm' as the message text.

func SequenceGetItem added in v0.2.3

func SequenceGetItem(o *Object, i SsizeT) *Object

Return the ith element of o, or NULL on failure.

This is the equivalent of the Python expression: o[i].

func SequenceGetSlice added in v0.2.3

func SequenceGetSlice(o *Object, i1 SsizeT, i2 SsizeT) *Object

Return the slice of sequence object o between i1 and i2, or NULL on failure.

This is the equivalent of the Python expression: o[i1:i2].

func SequenceInPlaceConcat added in v0.2.3

func SequenceInPlaceConcat(o1 *Object, o2 *Object) *Object

Append sequence 'o2' to sequence 'o1', in-place when possible. Return the resulting object, which could be 'o1', or NULL on failure.

This is the equivalent of the Python expression: o1 += o2.

func SequenceInPlaceRepeat added in v0.2.3

func SequenceInPlaceRepeat(o *Object, count SsizeT) *Object

Repeat sequence 'o' by 'count', in-place when possible. Return the resulting object, which could be 'o', or NULL on failure.

This is the equivalent of the Python expression: o1 *= count.

func SequenceList added in v0.2.3

func SequenceList(o *Object) *Object

Returns the sequence 'o' as a list on success, and NULL on failure. This is equivalent to the Python expression: list(o)

func SequenceRepeat added in v0.2.3

func SequenceRepeat(o *Object, count SsizeT) *Object

Return the result of repeating sequence object 'o' 'count' times, or NULL on failure.

This is the equivalent of the Python expression: o * count.

func SequenceTuple added in v0.2.3

func SequenceTuple(o *Object) *Object

Returns the sequence 'o' as a tuple on success, and NULL on failure.

This is equivalent to the Python expression: tuple(o).

func StateFindModule added in v0.2.3

func StateFindModule(_llcppg_param1 *ModuleDef) *Object

func StaticMethodNew added in v0.2.3

func StaticMethodNew(_llcppg_param1 *Object) *Object

func StructSequenceGetItem added in v0.2.3

func StructSequenceGetItem(_llcppg_param1 *Object, _llcppg_param2 SsizeT) *Object

func StructSequenceNew added in v0.2.3

func StructSequenceNew(type_ *TypeObject) *Object

func SysGetObject added in v0.2.0

func SysGetObject(_llcppg_param1 *c.Char) *Object

func SysGetXOptions added in v0.2.0

func SysGetXOptions() *Object

func ThreadGetInfo added in v0.2.0

func ThreadGetInfo() *Object

func ThreadStateGetDict added in v0.2.0

func ThreadStateGetDict() *Object

func TuplePack added in v0.2.0

func TuplePack(_llcppg_param1 SsizeT, __llgo_va_list ...any) *Object

func UnicodeDecode added in v0.2.0

func UnicodeDecode(s *c.Char, size SsizeT, encoding *c.Char, errors *c.Char) *Object

Create a Unicode object by decoding the encoded string s of the given size.

func UnicodeDecodeCharmap added in v0.2.0

func UnicodeDecodeCharmap(string *c.Char, length SsizeT, mapping *Object, errors *c.Char) *Object

--- Character Map Codecs -----------------------------------------------

This codec uses mappings to encode and decode characters.

Decoding mappings must map byte ordinals (integers in the range from 0 to 255) to Unicode strings, integers (which are then interpreted as Unicode ordinals) or None. Unmapped data bytes (ones which cause a LookupError) as well as mapped to None, 0xFFFE or '\ufffe' are treated as "undefined mapping" and cause an error.

Encoding mappings must map Unicode ordinal integers to bytes objects, integers in the range from 0 to 255 or None. Unmapped character ordinals (ones which cause a LookupError) as well as mapped to None are treated as "undefined mapping" and cause an error.

func UnicodeDecodeErrorCreate added in v0.2.0

func UnicodeDecodeErrorCreate(encoding *c.Char, object *c.Char, length SsizeT, start SsizeT, end SsizeT, reason *c.Char) *Object

create a UnicodeDecodeError object

func UnicodeDecodeErrorGetEncoding added in v0.2.3

func UnicodeDecodeErrorGetEncoding(_llcppg_param1 *Object) *Object

func UnicodeDecodeErrorGetObject added in v0.2.3

func UnicodeDecodeErrorGetObject(_llcppg_param1 *Object) *Object

func UnicodeDecodeErrorGetReason added in v0.2.3

func UnicodeDecodeErrorGetReason(_llcppg_param1 *Object) *Object

func UnicodeDecodeFSDefault added in v0.2.0

func UnicodeDecodeFSDefault(s *c.Char) *Object

Decode a null-terminated string from the Python filesystem encoding and error handler.

If the string length is known, use PyUnicode_DecodeFSDefaultAndSize().

func UnicodeDecodeFSDefaultAndSize added in v0.2.0

func UnicodeDecodeFSDefaultAndSize(s *c.Char, size SsizeT) *Object

Decode a string from the Python filesystem encoding and error handler.

func UnicodeDecodeLatin1 added in v0.2.0

func UnicodeDecodeLatin1(string *c.Char, length SsizeT, errors *c.Char) *Object

--- Latin-1 Codecs -----------------------------------------------------

Note: Latin-1 corresponds to the first 256 Unicode ordinals.

func UnicodeDecodeLocale added in v0.2.0

func UnicodeDecodeLocale(str *c.Char, errors *c.Char) *Object

Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string length using strlen().

func UnicodeDecodeLocaleAndSize added in v0.2.0

func UnicodeDecodeLocaleAndSize(str *c.Char, len SsizeT, errors *c.Char) *Object

Decode a string from the current locale encoding. The decoder is strict if surrogateescape* is equal to zero, otherwise it uses the 'surrogateescape' error handler (PEP 383) to escape undecodable bytes. If a byte sequence can be decoded as a surrogate character and *surrogateescape* is not equal to zero, the byte sequence is escaped using the 'surrogateescape' error handler instead of being decoded. *str* must end with a null character but cannot contain embedded null characters.

func UnicodeDecodeRawUnicodeEscape added in v0.2.0

func UnicodeDecodeRawUnicodeEscape(string *c.Char, length SsizeT, errors *c.Char) *Object

--- Raw-Unicode-Escape Codecs ------------------------------------------

func UnicodeDecodeUTF7 added in v0.2.0

func UnicodeDecodeUTF7(string *c.Char, length SsizeT, errors *c.Char) *Object

--- UTF-7 Codecs -------------------------------------------------------

func UnicodeDecodeUTF7Stateful added in v0.2.0

func UnicodeDecodeUTF7Stateful(string *c.Char, length SsizeT, errors *c.Char, consumed *SsizeT) *Object

func UnicodeDecodeUTF8 added in v0.2.0

func UnicodeDecodeUTF8(string *c.Char, length SsizeT, errors *c.Char) *Object

--- UTF-8 Codecs -------------------------------------------------------

func UnicodeDecodeUTF8Stateful added in v0.2.0

func UnicodeDecodeUTF8Stateful(string *c.Char, length SsizeT, errors *c.Char, consumed *SsizeT) *Object

func UnicodeDecodeUTF16 added in v0.2.0

func UnicodeDecodeUTF16(string *c.Char, length SsizeT, errors *c.Char, byteorder *c.Int) *Object

Decodes length bytes from a UTF-16 encoded buffer string and returns the corresponding Unicode object.

errors (if non-NULL) defines the error handling. It defaults to "strict".

If byteorder is non-NULL, the decoder starts decoding using the given byte order:

byteorder == -1: little endian byteorder == 0: native order byteorder == 1: big endian

In native mode, the first two bytes of the stream are checked for a BOM mark. If found, the BOM mark is analysed, the byte order adjusted and the BOM skipped. In the other modes, no BOM mark interpretation is done. After completion, *byteorder is set to the current byte order at the end of input data.

If byteorder is NULL, the codec starts in native order mode.

func UnicodeDecodeUTF16Stateful added in v0.2.0

func UnicodeDecodeUTF16Stateful(string *c.Char, length SsizeT, errors *c.Char, byteorder *c.Int, consumed *SsizeT) *Object

func UnicodeDecodeUTF32 added in v0.2.0

func UnicodeDecodeUTF32(string *c.Char, length SsizeT, errors *c.Char, byteorder *c.Int) *Object

Decodes length bytes from a UTF-32 encoded buffer string and returns the corresponding Unicode object.

errors (if non-NULL) defines the error handling. It defaults to "strict".

If byteorder is non-NULL, the decoder starts decoding using the given byte order:

byteorder == -1: little endian byteorder == 0: native order byteorder == 1: big endian

In native mode, the first four bytes of the stream are checked for a BOM mark. If found, the BOM mark is analysed, the byte order adjusted and the BOM skipped. In the other modes, no BOM mark interpretation is done. After completion, *byteorder is set to the current byte order at the end of input data.

If byteorder is NULL, the codec starts in native order mode.

func UnicodeDecodeUTF32Stateful added in v0.2.0

func UnicodeDecodeUTF32Stateful(string *c.Char, length SsizeT, errors *c.Char, byteorder *c.Int, consumed *SsizeT) *Object

func UnicodeDecodeUnicodeEscape added in v0.2.0

func UnicodeDecodeUnicodeEscape(string *c.Char, length SsizeT, errors *c.Char) *Object

--- Unicode-Escape Codecs ----------------------------------------------

func UnicodeEncodeErrorGetEncoding added in v0.2.3

func UnicodeEncodeErrorGetEncoding(_llcppg_param1 *Object) *Object

get the encoding attribute

func UnicodeEncodeErrorGetObject added in v0.2.3

func UnicodeEncodeErrorGetObject(_llcppg_param1 *Object) *Object

get the object attribute

func UnicodeEncodeErrorGetReason added in v0.2.3

func UnicodeEncodeErrorGetReason(_llcppg_param1 *Object) *Object

get the value of the reason attribute

func UnicodeInternFromString added in v0.2.0

func UnicodeInternFromString(u *c.Char) *Object

func UnicodeTranslateErrorGetObject added in v0.2.3

func UnicodeTranslateErrorGetObject(_llcppg_param1 *Object) *Object

func UnicodeTranslateErrorGetReason added in v0.2.3

func UnicodeTranslateErrorGetReason(_llcppg_param1 *Object) *Object

func UnicodeWriterFinish added in v0.2.3

func UnicodeWriterFinish(writer *UnicodeWriter) *Object

func Unicode_DecodeASCII added in v0.2.0

func Unicode_DecodeASCII(string *c.Char, length SsizeT, errors *c.Char) *Object

--- ASCII Codecs -------------------------------------------------------

Only 7-bit ASCII data is expected. All other codes generate errors.

func UnstableExcPrepReraiseStar added in v0.2.3

func UnstableExcPrepReraiseStar(orig *Object, excs *Object) *Object

In exceptions.c

func UnstableInterpreterFrameGetCode added in v0.2.3

func UnstableInterpreterFrameGetCode(frame *X_InterpreterFrame) *Object

Returns the code object of the frame (strong reference). Does not raise an exception.

func Unstable_Object_GC_NewWithExtraData added in v0.2.3

func Unstable_Object_GC_NewWithExtraData(_llcppg_param1 *TypeObject, _llcppg_param2 c.SizeT) *Object

func VaBuildValue added in v0.2.0

func VaBuildValue(_llcppg_param1 *c.Char, _llcppg_param2 c.VaList) *Object

func VectorcallCall added in v0.2.3

func VectorcallCall(callable *Object, tuple *Object, dict *Object) *Object

Call "callable" (which must support vectorcall) with positional arguments "tuple" and keyword arguments "dict". "dict" may also be NULL

func WeakrefGetObject added in v0.2.3

func WeakrefGetObject(ref *Object) *Object

func WeakrefNewProxy added in v0.2.3

func WeakrefNewProxy(ob *Object, callback *Object) *Object

func WeakrefNewRef added in v0.2.3

func WeakrefNewRef(ob *Object, callback *Object) *Object

func WrapperNew added in v0.2.3

func WrapperNew(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

func XNewRef added in v0.2.0

func XNewRef(obj *Object) *Object

Similar to Py_NewRef(), but the object can be NULL.

func X_CodeConstantKey added in v0.2.0

func X_CodeConstantKey(obj *Object) *Object

Create a comparable key used to compare constants taking in account the object type. It is used to make sure types are not coerced (e.g., float and complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms

Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) depending on the type and the value. The type is the first item to not compare bytes and str which can raise a BytesWarning exception.

func X_DictGetItemKnownHash added in v0.2.0

func X_DictGetItemKnownHash(mp *Object, key *Object, hash HashT) *Object

func X_DictGetItemStringWithError added in v0.2.0

func X_DictGetItemStringWithError(_llcppg_param1 *Object, _llcppg_param2 *c.Char) *Object

PyDict_GetItemStringRef() can be used instead

func X_DictNewPresized added in v0.2.0

func X_DictNewPresized(minused SsizeT) *Object

func X_DictPop added in v0.2.0

func X_DictPop(dict *Object, key *Object, default_value *Object) *Object

Use PyDict_Pop() instead

func X_EvalFrameDefault added in v0.2.1

func X_EvalFrameDefault(tstate *ThreadState, f *X_InterpreterFrame, exc c.Int) *Object

func X_LongCopy added in v0.2.0

func X_LongCopy(src *LongObject) *Object

Return a copy of src.

func X_LongFromByteArray added in v0.2.0

func X_LongFromByteArray(bytes *uint8, n c.SizeT, little_endian c.Int, is_signed c.Int) *Object

_PyLong_FromByteArray: View the n unsigned bytes as a binary integer in base 256, and return a Python int with the same numeric value. If n is 0, the integer is 0. Else: If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB; else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the LSB. If is_signed is 0/false, view the bytes as a non-negative integer. If is_signed is 1/true, view the bytes as a 2's-complement integer, non-negative if bit 0x80 of the MSB is clear, negative if set. Error returns: + Return NULL with the appropriate exception set if there's not enough memory to create the Python int.

func X_Long_GCD added in v0.2.0

func X_Long_GCD(_llcppg_param1 *Object, _llcppg_param2 *Object) *Object

For use by the gcd function in mathmodule.c

func X_ObjectCallMethodId added in v0.2.0

func X_ObjectCallMethodId(obj *Object, name *X_Identifier, format *c.Char, __llgo_va_list ...any) *Object

Like PyObject_CallMethod(), but expect a _Py_Identifier* as the method name.

func X_ObjectFunctionStr added in v0.2.0

func X_ObjectFunctionStr(_llcppg_param1 *Object) *Object

func X_ObjectGenericGetAttrWithDict added in v0.2.0

func X_ObjectGenericGetAttrWithDict(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object, _llcppg_param4 c.Int) *Object

Same as PyObject_Generic{Get,Set}Attr, but passing the attributes dict as the last parameter.

func X_ObjectGetAttrId added in v0.2.0

func X_ObjectGetAttrId(_llcppg_param1 *Object, _llcppg_param2 *X_Identifier) *Object

func X_ObjectGetDictPtr added in v0.2.0

func X_ObjectGetDictPtr(_llcppg_param1 *Object) **Object

func X_ObjectNew added in v0.2.0

func X_ObjectNew(_llcppg_param1 *TypeObject) *Object

func X_Object_GC_New added in v0.2.0

func X_Object_GC_New(_llcppg_param1 *TypeObject) *Object

func X_SliceFromIndices added in v0.2.0

func X_SliceFromIndices(start SsizeT, stop SsizeT) *Object

func X_StackAsDict added in v0.2.0

func X_StackAsDict(values **Object, kwnames *Object) *Object

Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) format to a Python dictionary ("kwargs" dict).

The type of kwnames keys is not checked. The final function getting arguments is responsible to check if all keys are strings, for example using PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().

Duplicate keys are merged using the last value. If duplicate keys must raise an exception, the caller is responsible to implement an explicit keys on kwnames.

func X_ThreadCurrentFrames added in v0.2.0

func X_ThreadCurrentFrames() *Object

The implementation of sys._current_frames() Returns a dict mapping thread id to that thread's current frame.

func X_TypeLookup added in v0.2.0

func X_TypeLookup(_llcppg_param1 *TypeObject, _llcppg_param2 *Object) *Object

func X_TypeLookupRef added in v0.2.0

func X_TypeLookupRef(_llcppg_param1 *TypeObject, _llcppg_param2 *Object) *Object

func X_UnicodeFromId added in v0.2.0

func X_UnicodeFromId(_llcppg_param1 *X_Identifier) *Object

Return an interned Unicode object for an Identifier; may fail if there is no memory.

func X_UnicodeWriterFinish added in v0.2.0

func X_UnicodeWriterFinish(writer *X_UnicodeWriter) *Object

Get the value of the writer as a Unicode string. Clear the buffer of the writer. Raise an exception and return NULL on error.

func (*Object) AIter added in v0.2.0

func (self *Object) AIter() *Object

Takes an AsyncIterable object and returns an AsyncIterator for it. This is typically a new iterator but if the argument is an AsyncIterator, this returns itself.

llgo:link (*Object).AIter C.PyObject_GetAIter

func (*Object) ASCII added in v0.2.0

func (self *Object) ASCII() *Object

llgo:link (*Object).ASCII C.PyObject_ASCII

func (*Object) AsByteArray added in v0.2.0

func (self *Object) AsByteArray() *ByteArrayObject

Direct API functions

llgo:link (*Object).AsByteArray C.PyByteArray_FromObject

func (*Object) AsBytes added in v0.2.0

func (self *Object) AsBytes() *BytesObject

llgo:link (*Object).AsBytes C.PyBytes_FromObject

func (*Object) AsFileDescriptor added in v0.2.0

func (self *Object) AsFileDescriptor() c.Int

llgo:link (*Object).AsFileDescriptor C.PyObject_AsFileDescriptor

func (*Object) AsMemoryView added in v0.2.0

func (self *Object) AsMemoryView() *MemoryViewObject

llgo:link (*Object).AsMemoryView C.PyMemoryView_FromObject

func (*Object) AsUnicode added in v0.2.0

func (self *Object) AsUnicode() *UnicodeObject

Copy an instance of a Unicode subtype to a new true Unicode object if necessary. If obj is already a true Unicode object (not a subtype), return the reference with *incremented* refcount.

The API returns NULL in case of an error. The caller is responsible for decref'ing the returned objects.

llgo:link (*Object).AsUnicode C.PyUnicode_FromObject

func (*Object) Attr added in v0.2.0

func (self *Object) Attr(_llcppg_param2 *Object) *Object

llgo:link (*Object).Attr C.PyObject_GetAttr

func (*Object) AttrString added in v0.2.0

func (self *Object) AttrString(_llcppg_param2 *c.Char) *Object

llgo:link (*Object).AttrString C.PyObject_GetAttrString

func (*Object) Buffer added in v0.2.0

func (self *Object) Buffer(view *Buffer, flags c.Int) c.Int

This is a C-API version of the getbuffer function call. It checks to make sure object has the required function pointer and issues the call.

Returns -1 and raises an error on failure and returns 0 on success.

llgo:link (*Object).Buffer C.PyObject_GetBuffer

func (*Object) Bytes added in v0.2.0

func (self *Object) Bytes() *Object

llgo:link (*Object).Bytes C.PyObject_Bytes

func (*Object) Call added in v0.2.0

func (self *Object) Call(args *Object, kwargs *Object) *Object

Call a callable Python object 'callable' with arguments given by the tuple 'args' and keywords arguments given by the dictionary 'kwargs'.

'args' must not be NULL, use an empty tuple if no arguments are needed. If no named arguments are needed, 'kwargs' can be NULL.

This is the equivalent of the Python expression: callable(*args, **kwargs).

llgo:link (*Object).Call C.PyObject_Call

func (*Object) CallFinalizer added in v0.2.0

func (self *Object) CallFinalizer()

llgo:link (*Object).CallFinalizer C.PyObject_CallFinalizer

func (*Object) CallFinalizerFromDealloc added in v0.2.0

func (self *Object) CallFinalizerFromDealloc() c.Int

llgo:link (*Object).CallFinalizerFromDealloc C.PyObject_CallFinalizerFromDealloc

func (*Object) CallFunction added in v0.2.0

func (self *Object) CallFunction(format *c.Char, __llgo_va_list ...any) *Object

Call a callable Python object, callable, with a variable number of C arguments. The C arguments are described using a mkvalue-style format string.

The format may be NULL, indicating that no arguments are provided.

Returns the result of the call on success, or NULL on failure.

This is the equivalent of the Python expression: callable(arg1, arg2, ...).

llgo:link (*Object).CallFunction C.PyObject_CallFunction

func (*Object) CallFunctionObjArgs added in v0.2.0

func (self *Object) CallFunctionObjArgs(__llgo_va_list ...any) *Object

Call a callable Python object 'callable' with a variable number of C arguments. The C arguments are provided as PyObject* values, terminated by a NULL.

Returns the result of the call on success, or NULL on failure.

This is the equivalent of the Python expression: callable(arg1, arg2, ...).

llgo:link (*Object).CallFunctionObjArgs C.PyObject_CallFunctionObjArgs

func (*Object) CallMethod added in v0.2.0

func (self *Object) CallMethod(name *c.Char, format *c.Char, __llgo_va_list ...any) *Object

Call the method named 'name' of object 'obj' with a variable number of C arguments. The C arguments are described by a mkvalue format string.

The format can be NULL, indicating that no arguments are provided.

Returns the result of the call on success, or NULL on failure.

This is the equivalent of the Python expression: obj.name(arg1, arg2, ...).

llgo:link (*Object).CallMethod C.PyObject_CallMethod

func (*Object) CallMethodObjArgs added in v0.2.0

func (self *Object) CallMethodObjArgs(name *Object, __llgo_va_list ...any) *Object

Call the method named 'name' of object 'obj' with a variable number of C arguments. The C arguments are provided as PyObject* values, terminated by NULL.

Returns the result of the call on success, or NULL on failure.

This is the equivalent of the Python expression: obj.name(*args).

llgo:link (*Object).CallMethodObjArgs C.PyObject_CallMethodObjArgs

func (*Object) CallNoArgs added in v0.2.0

func (self *Object) CallNoArgs() *Object

Call a callable Python object without any arguments

llgo:link (*Object).CallNoArgs C.PyObject_CallNoArgs

func (*Object) CallObject added in v0.2.3

func (self *Object) CallObject(args *Object) *Object

Call a callable Python object 'callable', with arguments given by the tuple 'args'. If no arguments are needed, then 'args' can be NULL.

Returns the result of the call on success, or NULL on failure.

This is the equivalent of the Python expression: callable(*args).

llgo:link (*Object).CallObject C.PyObject_CallObject

func (*Object) CallOneArg added in v0.2.0

func (self *Object) CallOneArg(arg *Object) *Object

llgo:link (*Object).CallOneArg C.PyObject_CallOneArg

func (*Object) CheckBuffer added in v0.2.0

func (self *Object) CheckBuffer() c.Int

Return 1 if the getbuffer function is available, otherwise return 0.

llgo:link (*Object).CheckBuffer C.PyObject_CheckBuffer

func (*Object) ClearManagedDict added in v0.2.0

func (self *Object) ClearManagedDict()

llgo:link (*Object).ClearManagedDict C.PyObject_ClearManagedDict

func (*Object) ClearWeakRefs added in v0.2.0

func (self *Object) ClearWeakRefs()

llgo:link (*Object).ClearWeakRefs C.PyObject_ClearWeakRefs

func (*Object) CopyData added in v0.2.0

func (self *Object) CopyData(src *Object) c.Int

Copy len bytes of data from the contiguous chunk of memory pointed to by buf into the buffer exported by obj. Return 0 on success and return -1 and raise a PyBuffer_Error on error (i.e. the object does not have a buffer interface or it is not working).

If fort is 'F', then if the object is multi-dimensional, then the data will be copied into the array in Fortran-style (first dimension varies the fastest). If fort is 'C', then the data will be copied into the array in C-style (last dimension varies the fastest). If fort is 'A', then it does not matter and the copy will be made in whatever way is more efficient.

llgo:link (*Object).CopyData C.PyObject_CopyData

func (*Object) DelAttr added in v0.2.0

func (self *Object) DelAttr(name *Object) c.Int

llgo:link (*Object).DelAttr C.PyObject_DelAttr

func (*Object) DelAttrString added in v0.2.0

func (self *Object) DelAttrString(name *c.Char) c.Int

llgo:link (*Object).DelAttrString C.PyObject_DelAttrString

func (*Object) DelItem added in v0.2.0

func (self *Object) DelItem(key *Object) c.Int

Delete the mapping for the object 'key' from the object 'o'. Returns -1 on failure.

This is the equivalent of the Python statement: del o[key].

llgo:link (*Object).DelItem C.PyObject_DelItem

func (*Object) DelItemString added in v0.2.0

func (self *Object) DelItemString(key *c.Char) c.Int

Remove the mapping for the string 'key' from the object 'o'. Returns -1 on failure.

This is equivalent to the Python statement: del o[key].

llgo:link (*Object).DelItemString C.PyObject_DelItemString

func (*Object) Dir added in v0.2.0

func (self *Object) Dir() *Object

PyObject_Dir(obj) acts like Python builtins.dir(obj), returning a list of strings. PyObject_Dir(NULL) is like builtins.dir(), returning the names of the current locals. In this case, if there are no current locals, NULL is returned, and PyErr_Occurred() is false.

llgo:link (*Object).Dir C.PyObject_Dir

func (*Object) Format added in v0.2.0

func (self *Object) Format(format_spec *Object) *Object

Takes an arbitrary object and returns the result of calling obj.__format__(format_spec).

llgo:link (*Object).Format C.PyObject_Format

func (*Object) GC_IsFinalized added in v0.2.0

func (self *Object) GC_IsFinalized() c.Int

llgo:link (*Object).GC_IsFinalized C.PyObject_GC_IsFinalized

func (*Object) GC_IsTracked added in v0.2.0

func (self *Object) GC_IsTracked() c.Int

llgo:link (*Object).GC_IsTracked C.PyObject_GC_IsTracked

func (*Object) GET_WEAKREFS_LISTPTR added in v0.2.0

func (self *Object) GET_WEAKREFS_LISTPTR() **Object

llgo:link (*Object).GET_WEAKREFS_LISTPTR C.PyObject_GET_WEAKREFS_LISTPTR

func (*Object) GenericGetAttr added in v0.2.0

func (self *Object) GenericGetAttr(_llcppg_param2 *Object) *Object

llgo:link (*Object).GenericGetAttr C.PyObject_GenericGetAttr

func (*Object) GenericGetDict added in v0.2.0

func (self *Object) GenericGetDict(_llcppg_param2 unsafe.Pointer) *Object

llgo:link (*Object).GenericGetDict C.PyObject_GenericGetDict

func (*Object) GenericHash added in v0.2.0

func (self *Object) GenericHash() HashT

llgo:link (*Object).GenericHash C.PyObject_GenericHash

func (*Object) GenericSetAttr added in v0.2.0

func (self *Object) GenericSetAttr(_llcppg_param2 *Object, _llcppg_param3 *Object) c.Int

llgo:link (*Object).GenericSetAttr C.PyObject_GenericSetAttr

func (*Object) GenericSetDict added in v0.2.0

func (self *Object) GenericSetDict(_llcppg_param2 *Object, _llcppg_param3 unsafe.Pointer) c.Int

llgo:link (*Object).GenericSetDict C.PyObject_GenericSetDict

func (*Object) HasAttr added in v0.2.0

func (self *Object) HasAttr(_llcppg_param2 *Object) c.Int

llgo:link (*Object).HasAttr C.PyObject_HasAttr

func (*Object) HasAttrString added in v0.2.0

func (self *Object) HasAttrString(_llcppg_param2 *c.Char) c.Int

llgo:link (*Object).HasAttrString C.PyObject_HasAttrString

func (*Object) HasAttrStringWithError added in v0.2.0

func (self *Object) HasAttrStringWithError(_llcppg_param2 *c.Char) c.Int

llgo:link (*Object).HasAttrStringWithError C.PyObject_HasAttrStringWithError

func (*Object) HasAttrWithError added in v0.2.0

func (self *Object) HasAttrWithError(_llcppg_param2 *Object) c.Int

llgo:link (*Object).HasAttrWithError C.PyObject_HasAttrWithError

func (*Object) Hash added in v0.2.0

func (self *Object) Hash() HashT

llgo:link (*Object).Hash C.PyObject_Hash

func (*Object) HashNotImplemented added in v0.2.0

func (self *Object) HashNotImplemented() HashT

llgo:link (*Object).HashNotImplemented C.PyObject_HashNotImplemented

func (*Object) IS_GC added in v0.2.0

func (self *Object) IS_GC() c.Int

Test if an object implements the garbage collector protocol

llgo:link (*Object).IS_GC C.PyObject_IS_GC

func (*Object) Init added in v0.2.0

func (self *Object) Init(_llcppg_param2 *TypeObject) *Object

Functions

llgo:link (*Object).Init C.PyObject_Init

func (*Object) IsInstance added in v0.2.0

func (self *Object) IsInstance(typeorclass *Object) c.Int

isinstance(object, typeorclass)

llgo:link (*Object).IsInstance C.PyObject_IsInstance

func (*Object) IsSubclass added in v0.2.0

func (self *Object) IsSubclass(typeorclass *Object) c.Int

issubclass(object, typeorclass)

llgo:link (*Object).IsSubclass C.PyObject_IsSubclass

func (*Object) IsTrue added in v0.2.0

func (self *Object) IsTrue() c.Int

llgo:link (*Object).IsTrue C.PyObject_IsTrue

func (*Object) Item added in v0.2.0

func (self *Object) Item(key *Object) *Object

Return element of 'o' corresponding to the object 'key'. Return NULL on failure.

This is the equivalent of the Python expression: o[key]

llgo:link (*Object).Item C.PyObject_GetItem

func (*Object) ItemData added in v0.2.0

func (self *Object) ItemData() unsafe.Pointer

llgo:link (*Object).ItemData C.PyObject_GetItemData

func (*Object) Iter added in v0.2.0

func (self *Object) Iter() *Object

Takes an object and returns an iterator for it. This is typically a new iterator but if the argument is an iterator, this returns itself.

llgo:link (*Object).Iter C.PyObject_GetIter

func (*Object) Length added in v0.2.0

func (self *Object) Length() SsizeT

llgo:link (*Object).Length C.PyObject_Length

func (*Object) LengthHint added in v0.2.0

func (self *Object) LengthHint(_llcppg_param2 SsizeT) SsizeT

Guess the size of object 'o' using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the default value. If one of the calls fails, this function returns -1.

llgo:link (*Object).LengthHint C.PyObject_LengthHint

func (*Object) Not added in v0.2.0

func (self *Object) Not() c.Int

llgo:link (*Object).Not C.PyObject_Not

func (*Object) ODictDelItem added in v0.2.3

func (self *Object) ODictDelItem(key *Object) c.Int

llgo:link (*Object).ODictDelItem C.PyODict_DelItem

func (*Object) ODictSetItem added in v0.2.3

func (self *Object) ODictSetItem(key *Object, item *Object) c.Int

llgo:link (*Object).ODictSetItem C.PyODict_SetItem

func (*Object) OptionalAttr added in v0.2.0

func (self *Object) OptionalAttr(_llcppg_param2 *Object, _llcppg_param3 **Object) c.Int

llgo:link (*Object).OptionalAttr C.PyObject_GetOptionalAttr

func (*Object) OptionalAttrString added in v0.2.0

func (self *Object) OptionalAttrString(_llcppg_param2 *c.Char, _llcppg_param3 **Object) c.Int

llgo:link (*Object).OptionalAttrString C.PyObject_GetOptionalAttrString

func (*Object) Print added in v0.2.0

func (self *Object) Print(_llcppg_param2 *c.FILE, _llcppg_param3 c.Int) c.Int

llgo:link (*Object).Print C.PyObject_Print

func (*Object) Repr added in v0.2.0

func (self *Object) Repr() *Object

Generic operations on objects

llgo:link (*Object).Repr C.PyObject_Repr

func (*Object) RichCompare added in v0.2.0

func (self *Object) RichCompare(_llcppg_param2 *Object, _llcppg_param3 c.Int) *Object

llgo:link (*Object).RichCompare C.PyObject_RichCompare

func (*Object) RichCompareBool added in v0.2.0

func (self *Object) RichCompareBool(_llcppg_param2 *Object, _llcppg_param3 c.Int) c.Int

llgo:link (*Object).RichCompareBool C.PyObject_RichCompareBool

func (*Object) SelfIter added in v0.2.0

func (self *Object) SelfIter() *Object

llgo:link (*Object).SelfIter C.PyObject_SelfIter

func (*Object) SetAttr added in v0.2.0

func (self *Object) SetAttr(_llcppg_param2 *Object, _llcppg_param3 *Object) c.Int

llgo:link (*Object).SetAttr C.PyObject_SetAttr

func (*Object) SetAttrString added in v0.2.0

func (self *Object) SetAttrString(_llcppg_param2 *c.Char, _llcppg_param3 *Object) c.Int

llgo:link (*Object).SetAttrString C.PyObject_SetAttrString

func (*Object) SetItem added in v0.2.0

func (self *Object) SetItem(key *Object, v *Object) c.Int

Map the object 'key' to the value 'v' into 'o'.

Raise an exception and return -1 on failure; return 0 on success.

This is the equivalent of the Python statement: o[key]=v.

llgo:link (*Object).SetItem C.PyObject_SetItem

func (*Object) Size added in v0.2.0

func (self *Object) Size() SsizeT

Return the size of object 'o'. If the object 'o' provides both sequence and mapping protocols, the sequence size is returned.

On error, -1 is returned.

This is the equivalent to the Python expression: len(o)

llgo:link (*Object).Size C.PyObject_Size

func (*Object) Str added in v0.2.0

func (self *Object) Str() *Object

llgo:link (*Object).Str C.PyObject_Str

func (*Object) Type added in v0.2.0

func (self *Object) Type() *Object

Get the type of an object.

On success, returns a type object corresponding to the object type of object 'o'. On failure, returns NULL.

This is equivalent to the Python expression: type(o)

llgo:link (*Object).Type C.PyObject_Type

func (*Object) TypeData added in v0.2.0

func (self *Object) TypeData(cls *TypeObject) unsafe.Pointer

llgo:link (*Object).TypeData C.PyObject_GetTypeData

func (*Object) Vectorcall added in v0.2.0

func (self *Object) Vectorcall(args **Object, nargsf c.SizeT, kwnames *Object) *Object

Perform a PEP 590-style vector call on 'callable'

llgo:link (*Object).Vectorcall C.PyObject_Vectorcall

func (*Object) VectorcallDict added in v0.2.0

func (self *Object) VectorcallDict(args **Object, nargsf c.SizeT, kwargs *Object) *Object

Same as PyObject_Vectorcall except that keyword arguments are passed as dict, which may be NULL if there are no keyword arguments.

llgo:link (*Object).VectorcallDict C.PyObject_VectorcallDict

func (*Object) VectorcallMethod added in v0.2.0

func (self *Object) VectorcallMethod(args **Object, nargsf c.SizeT, kwnames *Object) *Object

Call the method 'name' on args[0] with arguments in args[1..nargsf-1].

llgo:link (*Object).VectorcallMethod C.PyObject_VectorcallMethod

func (*Object) VisitManagedDict added in v0.2.0

func (self *Object) VisitManagedDict(visit Visitproc, arg unsafe.Pointer) c.Int

llgo:link (*Object).VisitManagedDict C.PyObject_VisitManagedDict

type ObjectArenaAllocator added in v0.2.0

type ObjectArenaAllocator struct {
	Ctx   unsafe.Pointer
	Alloc func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 c.SizeT) unsafe.Pointer
	Free  func(_llcppg_param1 unsafe.Pointer, _llcppg_param2 unsafe.Pointer, _llcppg_param3 c.SizeT)
}

This example code implements an object constructor with a custom allocator, where PyObject_New is inlined, and shows the important distinction between two steps (at least): 1) the actual allocation of the object storage; 2) the initialization of the Python specific fields in this storage with PyObject_{Init, InitVar}.

PyObject * YourObject_New(...) { PyObject *op;

op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); if (op == NULL) { return PyErr_NoMemory(); }

PyObject_Init(op, &YourTypeStruct);

op->ob_field = value; ... return op; }

Note that in C++, the use of the new operator usually implies that the 1st step is performed automatically for you, so in a C++ class constructor you would start directly with PyObject_Init/InitVar.

llgo:type C

func (*ObjectArenaAllocator) ObjectGetArenaAllocator added in v0.2.0

func (self *ObjectArenaAllocator) ObjectGetArenaAllocator()

Get the arena allocator.

llgo:link (*ObjectArenaAllocator).ObjectGetArenaAllocator C.PyObject_GetArenaAllocator

func (*ObjectArenaAllocator) ObjectSetArenaAllocator added in v0.2.0

func (self *ObjectArenaAllocator) ObjectSetArenaAllocator()

Set the arena allocator.

llgo:link (*ObjectArenaAllocator).ObjectSetArenaAllocator C.PyObject_SetArenaAllocator

type Objobjargproc

type Objobjargproc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) c.Int

llgo:type C

type Objobjproc

type Objobjproc = func(_llcppg_param1 *Object, _llcppg_param2 *Object) c.Int

llgo:type C

type OpenCodeHookFunction added in v0.2.0

type OpenCodeHookFunction = func(_llcppg_param1 *Object, _llcppg_param2 unsafe.Pointer) *Object

llgo:type C

type PY_UNICODE_TYPE

type PY_UNICODE_TYPE = c.WcharT

Py_UNICODE was the native Unicode storage format (code unit) used by Python and represents a single Unicode element in the Unicode type. With PEP 393, Py_UNICODE is deprecated and replaced with a typedef to wchar_t.

type PerfMapState

type PerfMapState struct {
	PerfMap *c.FILE
	MapLock ThreadTypeLock
}

Trampoline API

type PreConfig added in v0.2.0

type PreConfig struct {
	X_configInit      c.Int
	ParseArgv         c.Int
	Isolated          c.Int
	UseEnvironment    c.Int
	ConfigureLocale   c.Int
	CoerceCLocale     c.Int
	CoerceCLocaleWarn c.Int
	Utf8Mode          c.Int
	DevMode           c.Int
	Allocator         c.Int
}

--- PyPreConfig -----------------------------------------------

type Printfunc

type Printfunc = SsizeT

Allow printfunc in the tp_vectorcall_offset slot for backwards-compatibility

type RefTracer added in v0.2.0

type RefTracer = func(_llcppg_param1 *Object, _llcppg_param2 RefTracerEvent, _llcppg_param3 unsafe.Pointer) c.Int

llgo:type C

func RefTracerGetTracer added in v0.2.0

func RefTracerGetTracer(_llcppg_param1 *unsafe.Pointer) RefTracer

type RefTracerEvent added in v0.2.0

type RefTracerEvent c.Uint
const (
	RefTracer_CREATE  RefTracerEvent = 0
	RefTracer_DESTROY RefTracerEvent = 1
)

type Releasebufferproc

type Releasebufferproc = func(_llcppg_param1 *Object, _llcppg_param2 *Buffer)

llgo:type C

type Reprfunc

type Reprfunc = func(_llcppg_param1 *Object) *Object

llgo:type C

type Richcmpfunc

type Richcmpfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 c.Int) *Object

llgo:type C

type Sdigit

type Sdigit = c.Int32T

type SendResult added in v0.2.0

type SendResult c.Int

Result of calling PyIter_Send

const (
	PYGEN_RETURN SendResult = 0
	PYGEN_ERROR  SendResult = -1
	PYGEN_NEXT   SendResult = 1
)

func IterSend added in v0.2.3

func IterSend(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 **Object) SendResult

Takes generator, coroutine or iterator object and sends the value into it. Returns: - PYGEN_RETURN (0) if generator has returned. 'result' parameter is filled with return value - PYGEN_ERROR (-1) if exception was raised. 'result' parameter is NULL - PYGEN_NEXT (1) if generator has yielded. 'result' parameter is filled with yielded value.

type Sendfunc

type Sendfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 **Object) SendResult

llgo:type C

type SequenceMethods added in v0.2.0

type SequenceMethods struct {
	SqLength        Lenfunc
	SqConcat        Binaryfunc
	SqRepeat        Ssizeargfunc
	SqItem          Ssizeargfunc
	WasSqSlice      unsafe.Pointer
	SqAssItem       Ssizeobjargproc
	WasSqAssSlice   unsafe.Pointer
	SqContains      Objobjproc
	SqInplaceConcat Binaryfunc
	SqInplaceRepeat Ssizeargfunc
}

type SetObject added in v0.2.0

type SetObject struct {
	ObBase      Object
	Fill        SsizeT
	Used        SsizeT
	Mask        SsizeT
	Table       *Setentry
	Hash        HashT
	Finger      SsizeT
	Smalltable  [8]Setentry
	Weakreflist *Object
}

The SetObject data structure is shared by set and frozenset objects.

Invariant for sets: - hash is -1

Invariants for frozensets: - data is immutable. - hash is the hash of the frozenset or -1 if not computed yet.

func NewSet added in v0.2.3

func NewSet(_llcppg_param1 *Object) *SetObject

func (*SetObject) Add added in v0.2.3

func (self *SetObject) Add(key *Object) c.Int

llgo:link (*SetObject).Add C.PySet_Add

func (*SetObject) Clear added in v0.2.3

func (self *SetObject) Clear() c.Int

llgo:link (*SetObject).Clear C.PySet_Clear

func (*SetObject) Contains added in v0.2.3

func (self *SetObject) Contains(key *Object) c.Int

llgo:link (*SetObject).Contains C.PySet_Contains

func (*SetObject) Discard added in v0.2.3

func (self *SetObject) Discard(key *Object) c.Int

llgo:link (*SetObject).Discard C.PySet_Discard

func (*SetObject) Pop added in v0.2.3

func (self *SetObject) Pop() *Object

llgo:link (*SetObject).Pop C.PySet_Pop

func (*SetObject) Size added in v0.2.3

func (self *SetObject) Size() SsizeT

llgo:link (*SetObject).Size C.PySet_Size

type Setattrfunc

type Setattrfunc = func(_llcppg_param1 *Object, _llcppg_param2 *c.Char, _llcppg_param3 *Object) c.Int

llgo:type C

type Setattrofunc

type Setattrofunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) c.Int

llgo:type C

type Setentry

type Setentry struct {
	Key  *Object
	Hash HashT
}

type Setter

type Setter = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 unsafe.Pointer) c.Int

llgo:type C

type SliceObject added in v0.2.0

type SliceObject struct {
	ObBase Object
	Start  *Object
	Stop   *Object
	Step   *Object
}

func NewSlice added in v0.2.3

func NewSlice(start *Object, stop *Object, step *Object) *SliceObject

func (*SliceObject) Indices added in v0.2.3

func (self *SliceObject) Indices(length SsizeT, start *SsizeT, stop *SsizeT, step *SsizeT) c.Int

llgo:link (*SliceObject).Indices C.PySlice_GetIndices

func (*SliceObject) IndicesEx added in v0.2.3

func (self *SliceObject) IndicesEx(length SsizeT, start *SsizeT, stop *SsizeT, step *SsizeT, slicelength *SsizeT) c.Int

llgo:link (*SliceObject).IndicesEx C.PySlice_GetIndicesEx

func (*SliceObject) Unpack added in v0.2.3

func (self *SliceObject) Unpack(start *SsizeT, stop *SsizeT, step *SsizeT) c.Int

llgo:link (*SliceObject).Unpack C.PySlice_Unpack

type SsizeCleanT added in v0.2.0

type SsizeCleanT = SsizeT

Now PY_SSIZE_T_CLEAN is mandatory. This is just for backward compatibility.

type SsizeT added in v0.2.0

type SsizeT = c.SsizeT

func BufferSizeFromFormat added in v0.2.0

func BufferSizeFromFormat(format *c.Char) SsizeT

Return the implied itemsize of the data-format area from a struct-style description.

func GC_Collect added in v0.2.0

func GC_Collect() SsizeT

C equivalent of gc.collect().

func MappingLength added in v0.2.3

func MappingLength(o *Object) SsizeT

func MappingSize added in v0.2.3

func MappingSize(o *Object) SsizeT

Returns the number of keys in mapping object 'o' on success, and -1 on failure. This is equivalent to the Python expression: len(o).

func NumberAsSsizeT added in v0.2.3

func NumberAsSsizeT(o *Object, exc *Object) SsizeT

Returns the object 'o' converted to Py_ssize_t by going through PyNumber_Index() first.

If an overflow error occurs while converting the int to Py_ssize_t, then the second argument 'exc' is the error-type to return. If it is NULL, then the overflow error is cleared and the value is clipped.

func REFCNT added in v0.2.0

func REFCNT(ob *Object) SsizeT

Py_REFCNT() implementation for the stable ABI

func SequenceCount added in v0.2.3

func SequenceCount(o *Object, value *Object) SsizeT

Return the number of occurrences on value on 'o', that is, return the number of keys for which o[key] == value.

On failure, return -1. This is equivalent to the Python expression: o.count(value).

func SequenceIndex added in v0.2.3

func SequenceIndex(o *Object, value *Object) SsizeT

Return the first index for which o[i] == value. On error, return -1.

This is equivalent to the Python expression: o.index(value).

func SequenceLength added in v0.2.3

func SequenceLength(o *Object) SsizeT

func SequenceSize added in v0.2.3

func SequenceSize(o *Object) SsizeT

Return the size of sequence object o, or -1 on failure.

func SliceAdjustIndices added in v0.2.0

func SliceAdjustIndices(length SsizeT, start *SsizeT, stop *SsizeT, step SsizeT) SsizeT

func UnstableEvalRequestCodeExtraIndex added in v0.2.0

func UnstableEvalRequestCodeExtraIndex(_llcppg_param1 Freefunc) SsizeT

func UnstableLongCompactValue added in v0.2.3

func UnstableLongCompactValue(op *LongObject) SsizeT

func Vectorcall_NARGS added in v0.2.0

func Vectorcall_NARGS(nargsf c.SizeT) SsizeT

Given a vectorcall nargsf argument, return the actual number of arguments. (For use outside the limited API, this is re-defined as a static inline function in cpython/abstract.h)

type Ssizeargfunc

type Ssizeargfunc = func(_llcppg_param1 *Object, _llcppg_param2 SsizeT) *Object

llgo:type C

type Ssizeobjargproc

type Ssizeobjargproc = func(_llcppg_param1 *Object, _llcppg_param2 SsizeT, _llcppg_param3 *Object) c.Int

llgo:type C

type Ssizessizeargfunc

type Ssizessizeargfunc = func(_llcppg_param1 *Object, _llcppg_param2 SsizeT, _llcppg_param3 SsizeT) *Object

llgo:type C

type Ssizessizeobjargproc

type Ssizessizeobjargproc = func(_llcppg_param1 *Object, _llcppg_param2 SsizeT, _llcppg_param3 SsizeT, _llcppg_param4 *Object) c.Int

llgo:type C

type Status added in v0.2.0

type Status struct {
	X_type   _llcppg_anon_4
	Func     *c.Char
	ErrMsg   *c.Char
	Exitcode c.Int
}

--- PyStatus -----------------------------------------------

func ConfigRead added in v0.2.3

func ConfigRead(config *Config) Status

func ConfigSetArgv added in v0.2.3

func ConfigSetArgv(config *Config, argc SsizeT, argv **c.WcharT) Status

func ConfigSetBytesArgv added in v0.2.3

func ConfigSetBytesArgv(config *Config, argc SsizeT, argv **c.Char) Status

func ConfigSetBytesString added in v0.2.3

func ConfigSetBytesString(config *Config, config_str **c.WcharT, str *c.Char) Status

func ConfigSetString added in v0.2.3

func ConfigSetString(config *Config, config_str **c.WcharT, str *c.WcharT) Status

func ConfigSetWideStringList added in v0.2.3

func ConfigSetWideStringList(config *Config, list *WideStringList, length SsizeT, items **c.WcharT) Status

func InitializeFromConfig added in v0.2.0

func InitializeFromConfig(config *Config) Status

Initialization and finalization

func NewInterpreterFromConfig added in v0.2.0

func NewInterpreterFromConfig(tstate_p **ThreadState, config *InterpreterConfig) Status

func PreInitialize added in v0.2.0

func PreInitialize(src_config *PreConfig) Status

PEP 432 Multi-phase initialization API (Private while provisional!)

func PreInitializeFromArgs added in v0.2.0

func PreInitializeFromArgs(src_config *PreConfig, argc SsizeT, argv **c.WcharT) Status

func PreInitializeFromBytesArgs added in v0.2.0

func PreInitializeFromBytesArgs(src_config *PreConfig, argc SsizeT, argv **c.Char) Status

func StatusError added in v0.2.0

func StatusError(err_msg *c.Char) Status

func StatusExit added in v0.2.0

func StatusExit(exitcode c.Int) Status

func StatusNoMemory added in v0.2.0

func StatusNoMemory() Status

func StatusOk added in v0.2.0

func StatusOk() Status

func WideStringListAppend added in v0.2.3

func WideStringListAppend(list *WideStringList, item *c.WcharT) Status

func WideStringListInsert added in v0.2.3

func WideStringListInsert(list *WideStringList, index SsizeT, item *c.WcharT) Status

type StopIterationObject added in v0.2.0

type StopIterationObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Value           *Object
}

type StructSequence added in v0.2.0

type StructSequence = TupleObject

type StructSequenceDesc added in v0.2.0

type StructSequenceDesc struct {
	Name        *c.Char
	Doc         *c.Char
	Fields      *StructSequenceField
	NInSequence c.Int
}

type StructSequenceField added in v0.2.0

type StructSequenceField struct {
	Name *c.Char
	Doc  *c.Char
}

type Stwodigits

type Stwodigits = c.Int64T

type SyntaxErrorObject added in v0.2.0

type SyntaxErrorObject struct {
	ObBase           Object
	Dict             *Object
	Args             *Object
	Notes            *Object
	Traceback        *Object
	Context          *Object
	Cause            *Object
	SuppressContext  c.Char
	Msg              *Object
	Filename         *Object
	Lineno           *Object
	Offset           *Object
	EndLineno        *Object
	EndOffset        *Object
	Text             *Object
	PrintFileAndLine *Object
	Metadata         *Object
}

type SystemExitObject added in v0.2.0

type SystemExitObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Code            *Object
}

type Ternaryfunc

type Ternaryfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 *Object) *Object

llgo:type C

type ThreadState added in v0.2.0

type ThreadState = X_ts

func EvalSaveThread added in v0.2.0

func EvalSaveThread() *ThreadState

Interface for threads.

A module that plans to do a blocking system call (or something else that lasts a long time and doesn't touch Python data) can allow other threads to run as follows:

...preparations here... Py_BEGIN_ALLOW_THREADS ...blocking system call here... Py_END_ALLOW_THREADS ...interpret result here...

The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a {}-surrounded block. To leave the block in the middle (e.g., with return), you must insert a line containing Py_BLOCK_THREADS before the return, e.g.

if (...premature_exit...) { Py_BLOCK_THREADS PyErr_SetFromErrno(PyExc_OSError); return NULL; }

An alternative is:

Py_BLOCK_THREADS if (...premature_exit...) { PyErr_SetFromErrno(PyExc_OSError); return NULL; } Py_UNBLOCK_THREADS

For convenience, that the value of 'errno' is restored across Py_END_ALLOW_THREADS and Py_BLOCK_THREADS.

WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND Py_END_ALLOW_THREADS!!!

Note that not yet all candidates have been converted to use this mechanism!

func GILStateGetThisThreadState added in v0.2.0

func GILStateGetThisThreadState() *ThreadState

Helper/diagnostic function - get the current thread state for this thread. May return NULL if no GILState API has been used on the current thread. Note that the main thread always has such a thread-state, even if no auto-thread-state call has been made on the main thread.

func InterpreterStateThreadHead added in v0.2.3

func InterpreterStateThreadHead(_llcppg_param1 *InterpreterState) *ThreadState

func NewInterpreter added in v0.2.0

func NewInterpreter() *ThreadState

Subinterpreter support

func ThreadStateGet added in v0.2.0

func ThreadStateGet() *ThreadState

Get the current thread state.

When the current thread state is NULL, this issues a fatal error (so that the caller needn't check for NULL).

The caller must hold the GIL.

See also PyThreadState_GetUnchecked() and _PyThreadState_GET().

func ThreadStateGetUnchecked added in v0.2.0

func ThreadStateGetUnchecked() *ThreadState

Similar to PyThreadState_Get(), but don't issue a fatal error if it is NULL.

func ThreadStateNew added in v0.2.3

func ThreadStateNew(_llcppg_param1 *InterpreterState) *ThreadState

func ThreadStateNext added in v0.2.3

func ThreadStateNext(_llcppg_param1 *ThreadState) *ThreadState

func ThreadStateSwap added in v0.2.3

func ThreadStateSwap(_llcppg_param1 *ThreadState) *ThreadState

type ThreadTypeLock added in v0.2.0

type ThreadTypeLock uintptr

func ThreadAllocateLock added in v0.2.0

func ThreadAllocateLock() ThreadTypeLock

type TimeT added in v0.2.0

type TimeT = c.Int64T

type TracebackObject added in v0.2.0

type TracebackObject = X_traceback

type Tracefunc added in v0.2.0

type Tracefunc = func(_llcppg_param1 *Object, _llcppg_param2 *FrameObject, _llcppg_param3 c.Int, _llcppg_param4 *Object) c.Int

Py_tracefunc return -1 when raising an exception, or 0 for success.

llgo:type C

type Traverseproc

type Traverseproc = func(_llcppg_param1 *Object, _llcppg_param2 Visitproc, _llcppg_param3 unsafe.Pointer) c.Int

llgo:type C

type TssT added in v0.2.0

type TssT = X_tssT

New in 3.7 Thread Specific Storage (TSS) API

func ThreadTssAlloc added in v0.2.0

func ThreadTssAlloc() *TssT

type TupleObject added in v0.2.0

type TupleObject struct {
	ObBase VarObject
	ObHash HashT
	ObItem [1]*Object
}

func NewTuple added in v0.2.3

func NewTuple(size SsizeT) *TupleObject

func (*TupleObject) Item added in v0.2.3

func (self *TupleObject) Item(_llcppg_param2 SsizeT) *Object

llgo:link (*TupleObject).Item C.PyTuple_GetItem

func (*TupleObject) SetItem added in v0.2.3

func (self *TupleObject) SetItem(_llcppg_param2 SsizeT, _llcppg_param3 *Object) c.Int

llgo:link (*TupleObject).SetItem C.PyTuple_SetItem

func (*TupleObject) Size added in v0.2.3

func (self *TupleObject) Size() SsizeT

llgo:link (*TupleObject).Size C.PyTuple_Size

func (*TupleObject) Slice added in v0.2.3

func (self *TupleObject) Slice(_llcppg_param2 SsizeT, _llcppg_param3 SsizeT) *Object

llgo:link (*TupleObject).Slice C.PyTuple_GetSlice

type Twodigits

type Twodigits = c.Uint64T

type TypeObject added in v0.2.0

type TypeObject = X_typeobject
var AsyncGenType TypeObject
var BaseObjectType TypeObject

built-in 'object'

var BoolType TypeObject
var ByteArrayIterType TypeObject
var ByteArrayType TypeObject

Type object

var BytesIterType TypeObject
var BytesType TypeObject

Type PyBytesObject represents a byte string. An extra zero byte is reserved at the end to ensure it is zero-terminated, but a size is present so strings with null bytes in them can be represented. This is an immutable object type.

There are functions to create new bytes objects, to test an object for bytes-ness, and to get the byte string value. The latter function returns a null pointer if the object is not of the proper type. There is a variant that takes an explicit size as well as a variant that assumes a zero-terminated string. Note that none of the functions should be applied to NULL pointer.

var CFunctionType TypeObject

This is about the type 'builtin_function_or_method', not Python methods in user-defined classes. See classobject.h for the latter.

var CMethodType TypeObject
var CallIterType TypeObject
var CapsuleType TypeObject
var CellType TypeObject
var ClassMethodDescrType TypeObject
var ClassMethodType TypeObject

The classmethod and staticmethod types lives here, too

var CodeType TypeObject
var ComplexType TypeObject

Complex object interface

var ContextTokenType TypeObject
var ContextType TypeObject
var ContextVarType TypeObject
var CoroType TypeObject
var DictItemsType TypeObject
var DictIterItemType TypeObject
var DictIterKeyType TypeObject

Dictionary (key, value, items) iterators

var DictIterValueType TypeObject
var DictKeysType TypeObject

Dictionary (keys, values, items) views

var DictProxyType TypeObject
var DictRevIterItemType TypeObject
var DictRevIterKeyType TypeObject
var DictRevIterValueType TypeObject
var DictType TypeObject

The distribution includes a separate file, Objects/dictnotes.txt, describing explorations into dictionary design and optimization. It covers typical dictionary use patterns, the parameters for tuning dictionaries, and several ideas for possible optimizations.

var DictValuesType TypeObject
var EllipsisType TypeObject
var EnumType TypeObject
var FilterType TypeObject
var FloatType TypeObject
var FrameLocalsProxyType TypeObject
var FrameType TypeObject
var FrozenSetType TypeObject
var FunctionType TypeObject
var GenType TypeObject
var GenericAliasType TypeObject
var GetSetDescrType TypeObject
var InstanceMethodType TypeObject
var ListIterType TypeObject
var ListRevIterType TypeObject
var ListType TypeObject
var LongRangeIterType TypeObject
var LongType TypeObject
var MapType TypeObject
var MemberDescrType TypeObject
var MemoryViewType TypeObject
var MethodDescrType TypeObject
var MethodType TypeObject
var ModuleDefType TypeObject
var ModuleType TypeObject
var ODictItemsType TypeObject
var ODictIterType TypeObject
var ODictKeysType TypeObject
var ODictType TypeObject
var ODictValuesType TypeObject
var PickleBufferType TypeObject
var PropertyType TypeObject
var RangeIterType TypeObject
var RangeType TypeObject

A range object represents an integer range. This is an immutable object; a range cannot change its value after creation.

Range objects behave like the corresponding tuple objects except that they are represented by a start, stop, and step datamembers.

var ReversedType TypeObject
var SeqIterType TypeObject
var SetIterType TypeObject
var SetType TypeObject
var SliceType TypeObject
var StaticMethodType TypeObject
var StdPrinterType TypeObject
var SuperType TypeObject

built-in 'super'

var TraceBackType TypeObject

Reveal traceback type so we can typecheck traceback objects

var TupleIterType TypeObject
var TupleType TypeObject

Another generally useful object type is a tuple of object pointers. For Python, this is an immutable type. C code can change the tuple items (but not their number), and even use tuples as general-purpose arrays of object references, but in general only brand new tuples should be mutated, not ones that might already have been exposed to Python code.

** WARNING *** PyTuple_SetItem does not increment the new item's reference count, but does decrement the reference count of the item it replaces, if not nil. It does *decrement* the reference count if it is *not* inserted in the tuple. Similarly, PyTuple_GetItem does not increment the returned item's reference count.

var TypeType TypeObject

built-in 'type'

var UnicodeIterType TypeObject
var UnicodeType TypeObject
var WrapperDescrType TypeObject
var X_AsyncGenASendType TypeObject
var X_WeakrefCallableProxyType TypeObject
var X_WeakrefProxyType TypeObject
var X_WeakrefRefType TypeObject
var ZipType TypeObject

func StructSequenceNewType added in v0.2.3

func StructSequenceNewType(desc *StructSequenceDesc) *TypeObject

func TYPE added in v0.2.0

func TYPE(ob *Object) *TypeObject

Py_TYPE() implementation for the stable ABI

func TypeFromMetaclass added in v0.2.4

func TypeFromMetaclass(_llcppg_param1 *TypeObject, _llcppg_param2 *Object, _llcppg_param3 *TypeSpec, _llcppg_param4 *Object) *TypeObject

func TypeFromModuleAndSpec added in v0.2.4

func TypeFromModuleAndSpec(_llcppg_param1 *Object, _llcppg_param2 *TypeSpec, _llcppg_param3 *Object) *TypeObject

func TypeFromSpec added in v0.2.4

func TypeFromSpec(_llcppg_param1 *TypeSpec) *TypeObject

func TypeFromSpecWithBases added in v0.2.4

func TypeFromSpecWithBases(_llcppg_param1 *TypeSpec, _llcppg_param2 *Object) *TypeObject

func (*TypeObject) BaseByToken added in v0.2.3

func (self *TypeObject) BaseByToken(_llcppg_param2 unsafe.Pointer, _llcppg_param3 **TypeObject) c.Int

llgo:link (*TypeObject).BaseByToken C.PyType_GetBaseByToken

func (*TypeObject) DataSize added in v0.2.3

func (self *TypeObject) DataSize() SsizeT

llgo:link (*TypeObject).DataSize C.PyType_GetTypeDataSize

func (*TypeObject) DescrNewClassMethod added in v0.2.3

func (self *TypeObject) DescrNewClassMethod(_llcppg_param2 *MethodDef) *Object

llgo:link (*TypeObject).DescrNewClassMethod C.PyDescr_NewClassMethod

func (*TypeObject) DescrNewGetSet added in v0.2.3

func (self *TypeObject) DescrNewGetSet(_llcppg_param2 *GetSetDef) *Object

llgo:link (*TypeObject).DescrNewGetSet C.PyDescr_NewGetSet

func (*TypeObject) DescrNewMember added in v0.2.3

func (self *TypeObject) DescrNewMember(_llcppg_param2 *MemberDef) *Object

llgo:link (*TypeObject).DescrNewMember C.PyDescr_NewMember

func (*TypeObject) DescrNewMethod added in v0.2.3

func (self *TypeObject) DescrNewMethod(_llcppg_param2 *MethodDef) *Object

llgo:link (*TypeObject).DescrNewMethod C.PyDescr_NewMethod

func (*TypeObject) DescrNewWrapper added in v0.2.3

func (self *TypeObject) DescrNewWrapper(_llcppg_param2 *Wrapperbase, _llcppg_param3 unsafe.Pointer) *Object

llgo:link (*TypeObject).DescrNewWrapper C.PyDescr_NewWrapper

func (*TypeObject) Dict added in v0.2.3

func (self *TypeObject) Dict() *Object

llgo:link (*TypeObject).Dict C.PyType_GetDict

func (*TypeObject) Flags added in v0.2.3

func (self *TypeObject) Flags() c.Ulong

llgo:link (*TypeObject).Flags C.PyType_GetFlags

func (*TypeObject) Freeze added in v0.2.3

func (self *TypeObject) Freeze() c.Int

llgo:link (*TypeObject).Freeze C.PyType_Freeze

func (*TypeObject) FullyQualifiedName added in v0.2.3

func (self *TypeObject) FullyQualifiedName() *Object

llgo:link (*TypeObject).FullyQualifiedName C.PyType_GetFullyQualifiedName

func (*TypeObject) GenericAlloc added in v0.2.3

func (self *TypeObject) GenericAlloc(_llcppg_param2 SsizeT) *Object

llgo:link (*TypeObject).GenericAlloc C.PyType_GenericAlloc

func (*TypeObject) GenericNew added in v0.2.3

func (self *TypeObject) GenericNew(_llcppg_param2 *Object, _llcppg_param3 *Object) *Object

llgo:link (*TypeObject).GenericNew C.PyType_GenericNew

func (*TypeObject) IsSubtype added in v0.2.3

func (self *TypeObject) IsSubtype(_llcppg_param2 *TypeObject) c.Int

Generic type check

llgo:link (*TypeObject).IsSubtype C.PyType_IsSubtype

func (*TypeObject) Modified added in v0.2.3

func (self *TypeObject) Modified()

llgo:link (*TypeObject).Modified C.PyType_Modified

func (*TypeObject) Module added in v0.2.3

func (self *TypeObject) Module() *Object

llgo:link (*TypeObject).Module C.PyType_GetModule

func (*TypeObject) ModuleByDef added in v0.2.3

func (self *TypeObject) ModuleByDef(_llcppg_param2 *ModuleDef) *Object

llgo:link (*TypeObject).ModuleByDef C.PyType_GetModuleByDef

func (*TypeObject) ModuleName added in v0.2.3

func (self *TypeObject) ModuleName() *Object

llgo:link (*TypeObject).ModuleName C.PyType_GetModuleName

func (*TypeObject) ModuleState added in v0.2.3

func (self *TypeObject) ModuleState() unsafe.Pointer

llgo:link (*TypeObject).ModuleState C.PyType_GetModuleState

func (*TypeObject) Name added in v0.2.3

func (self *TypeObject) Name() *Object

llgo:link (*TypeObject).Name C.PyType_GetName

func (*TypeObject) QualName added in v0.2.3

func (self *TypeObject) QualName() *Object

llgo:link (*TypeObject).QualName C.PyType_GetQualName

func (*TypeObject) Ready added in v0.2.3

func (self *TypeObject) Ready() c.Int

llgo:link (*TypeObject).Ready C.PyType_Ready

func (*TypeObject) Slot added in v0.2.3

func (self *TypeObject) Slot(_llcppg_param2 c.Int) unsafe.Pointer

llgo:link (*TypeObject).Slot C.PyType_GetSlot

func (*TypeObject) Type_SUPPORTS_WEAKREFS added in v0.2.3

func (self *TypeObject) Type_SUPPORTS_WEAKREFS() c.Int

Test if a type supports weak references

llgo:link (*TypeObject).Type_SUPPORTS_WEAKREFS C.PyType_SUPPORTS_WEAKREFS

type TypeSlot added in v0.2.0

type TypeSlot struct {
	Slot  c.Int
	Pfunc unsafe.Pointer
}

type TypeSpec added in v0.2.0

type TypeSpec struct {
	Name      *c.Char
	Basicsize c.Int
	Itemsize  c.Int
	Flags     c.Uint
	Slots     *TypeSlot
}

type TypeWatchCallback added in v0.2.0

type TypeWatchCallback = func(_llcppg_param1 *TypeObject) c.Int

llgo:type C

type UCS1 added in v0.2.0

type UCS1 = c.Uint8T

type UCS2 added in v0.2.0

type UCS2 = c.Uint16T

type UCS4 added in v0.2.0

type UCS4 = c.Uint32T

Py_UCS4 and Py_UCS2 are typedefs for the respective unicode representations.

func X_UnicodeToLowercase added in v0.2.0

func X_UnicodeToLowercase(ch UCS4) UCS4

func X_UnicodeToTitlecase added in v0.2.0

func X_UnicodeToTitlecase(ch UCS4) UCS4

func X_UnicodeToUppercase added in v0.2.0

func X_UnicodeToUppercase(ch UCS4) UCS4

type UNICODE added in v0.2.0

type UNICODE = c.WcharT

type UhashT added in v0.2.0

type UhashT = c.SizeT

type UintptrT added in v0.2.0

type UintptrT = c.UintptrT

uintptr_t is the C9X name for an unsigned integral type such that a legitimate void* can be cast to uintptr_t and then back to void* again without loss of information. Similarly for intptr_t, wrt a signed integral type.

type Unaryfunc

type Unaryfunc = func(_llcppg_param1 *Object) *Object

Type objects contain a string containing the type name (to help somewhat in debugging), the allocation parameters (see PyObject_New() and PyObject_NewVar()), and methods for accessing objects of the type. Methods are optional, a nil pointer meaning that particular kind of access is not available for this type. The Py_DECREF() macro uses the tp_dealloc method without checking for a nil pointer; it should always be implemented except if the implementation can guarantee that the reference count will never reach zero (e.g., for statically allocated type objects).

NB: the methods for certain type groups are now contained in separate method blocks.

llgo:type C

type UnicodeErrorObject added in v0.2.0

type UnicodeErrorObject struct {
	ObBase          Object
	Dict            *Object
	Args            *Object
	Notes           *Object
	Traceback       *Object
	Context         *Object
	Cause           *Object
	SuppressContext c.Char
	Encoding        *Object
	Object          *Object
	Start           SsizeT
	End             SsizeT
	Reason          *Object
}

type UnicodeKind added in v0.2.0

type UnicodeKind c.Uint
const (
	// Return values of the PyUnicode_KIND() function:
	Unicode_1BYTE_KIND UnicodeKind = 1
	// Return values of the PyUnicode_KIND() function:
	Unicode_2BYTE_KIND UnicodeKind = 2
	// Return values of the PyUnicode_KIND() function:
	Unicode_4BYTE_KIND UnicodeKind = 4
)

type UnicodeObject added in v0.2.0

type UnicodeObject struct {
	X_base CompactUnicodeObject
	Data   _llcppg_anon_3
}

Object format for Unicode subclasses.

func NewUnicode added in v0.2.3

func NewUnicode(size SsizeT, maxchar UCS4) *UnicodeObject

With PEP 393, this is the recommended way to allocate a new unicode object. This function will allocate the object and its buffer in a single memory block. Objects created using this function are not resizable.

func UnicodeFromEncodedObject added in v0.2.4

func UnicodeFromEncodedObject(obj *Object, encoding *c.Char, errors *c.Char) *UnicodeObject

Decode obj to a Unicode object.

bytes, bytearray and other bytes-like objects are decoded according to the given encoding and error handler. The encoding and error handler can be NULL to have the interface use UTF-8 and "strict".

All other objects (including Unicode objects) raise an exception.

The API returns NULL in case of an error. The caller is responsible for decref'ing the returned objects.

func UnicodeFromFormat added in v0.2.0

func UnicodeFromFormat(format *c.Char, __llgo_va_list ...any) *UnicodeObject

func UnicodeFromFormatV added in v0.2.4

func UnicodeFromFormatV(format *c.Char, vargs c.VaList) *UnicodeObject

func UnicodeFromKindAndData added in v0.2.0

func UnicodeFromKindAndData(kind c.Int, buffer unsafe.Pointer, size SsizeT) *UnicodeObject

Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters. Scan the string to find the maximum character.

func UnicodeFromOrdinal added in v0.2.0

func UnicodeFromOrdinal(ordinal c.Int) *UnicodeObject

Create a Unicode Object from the given Unicode code point ordinal.

The ordinal must be in range(0x110000). A ValueError is raised in case it is not.

func UnicodeFromString added in v0.2.0

func UnicodeFromString(u *c.Char) *UnicodeObject

Similar to PyUnicode_FromUnicode(), but u points to null-terminated UTF-8 encoded bytes. The size is determined with strlen().

func UnicodeFromStringAndSize added in v0.2.0

func UnicodeFromStringAndSize(u *c.Char, size SsizeT) *UnicodeObject

Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes

func UnicodeFromWideChar added in v0.2.0

func UnicodeFromWideChar(w *c.WcharT, size SsizeT) *UnicodeObject

Create a Unicode Object from the wchar_t buffer w of the given size.

The buffer is copied into the new object.

func (*UnicodeObject) AsASCIIString added in v0.2.3

func (self *UnicodeObject) AsASCIIString() *Object

llgo:link (*UnicodeObject).AsASCIIString C.PyUnicode_AsASCIIString

func (*UnicodeObject) AsCharmapString added in v0.2.3

func (self *UnicodeObject) AsCharmapString(mapping *Object) *Object

llgo:link (*UnicodeObject).AsCharmapString C.PyUnicode_AsCharmapString

func (*UnicodeObject) AsDecoded added in v0.2.3

func (self *UnicodeObject) AsDecoded(encoding *c.Char, errors *c.Char) *Object

Decode a Unicode object unicode and return the result as Unicode object.

This API is DEPRECATED and will be removed in 3.15. The only supported standard encoding is rot13. Use PyCodec_Decode() to decode with rot13 and non-standard codecs that decode from str to str.

llgo:link (*UnicodeObject).AsDecoded C.PyUnicode_AsDecodedUnicode

func (*UnicodeObject) AsDecodedObject added in v0.2.3

func (self *UnicodeObject) AsDecodedObject(encoding *c.Char, errors *c.Char) *Object

Decode a Unicode object unicode and return the result as Python object.

This API is DEPRECATED and will be removed in 3.15. The only supported standard encoding is rot13. Use PyCodec_Decode() to decode with rot13 and non-standard codecs that decode from str.

llgo:link (*UnicodeObject).AsDecodedObject C.PyUnicode_AsDecodedObject

func (*UnicodeObject) AsEncoded added in v0.2.3

func (self *UnicodeObject) AsEncoded(encoding *c.Char, errors *c.Char) *Object

Encodes a Unicode object and returns the result as Unicode object.

This API is DEPRECATED and will be removed in 3.15. The only supported standard encodings is rot13. Use PyCodec_Encode() to encode with rot13 and non-standard codecs that encode from str to str.

llgo:link (*UnicodeObject).AsEncoded C.PyUnicode_AsEncodedUnicode

func (*UnicodeObject) AsEncodedObject added in v0.2.3

func (self *UnicodeObject) AsEncodedObject(encoding *c.Char, errors *c.Char) *Object

Encodes a Unicode object and returns the result as Python object.

This API is DEPRECATED and will be removed in 3.15. It is superseded by PyUnicode_AsEncodedString() since all standard encodings (except rot13) encode str to bytes. Use PyCodec_Encode() for encoding with rot13 and non-standard codecs that encode form str to non-bytes.

llgo:link (*UnicodeObject).AsEncodedObject C.PyUnicode_AsEncodedObject

func (*UnicodeObject) AsEncodedString added in v0.2.3

func (self *UnicodeObject) AsEncodedString(encoding *c.Char, errors *c.Char) *Object

Encodes a Unicode object and returns the result as Python string object.

llgo:link (*UnicodeObject).AsEncodedString C.PyUnicode_AsEncodedString

func (*UnicodeObject) AsLatin1String added in v0.2.3

func (self *UnicodeObject) AsLatin1String() *Object

llgo:link (*UnicodeObject).AsLatin1String C.PyUnicode_AsLatin1String

func (*UnicodeObject) AsRawUnicodeEscapeString added in v0.2.3

func (self *UnicodeObject) AsRawUnicodeEscapeString() *Object

llgo:link (*UnicodeObject).AsRawUnicodeEscapeString C.PyUnicode_AsRawUnicodeEscapeString

func (*UnicodeObject) AsUCS4 added in v0.2.3

func (self *UnicodeObject) AsUCS4(buffer *UCS4, buflen SsizeT, copy_null c.Int) *UCS4

Copy the string into a UCS4 buffer including the null character if copy_null is set. Return NULL and raise an exception on error. Raise a SystemError if the buffer is smaller than the string. Return buffer on success.

buflen is the length of the buffer in (Py_UCS4) characters.

llgo:link (*UnicodeObject).AsUCS4 C.PyUnicode_AsUCS4

func (*UnicodeObject) AsUCS4Copy added in v0.2.3

func (self *UnicodeObject) AsUCS4Copy() *UCS4

Copy the string into a UCS4 buffer. A new buffer is allocated using PyMem_Malloc; if this fails, NULL is returned with a memory error exception set.

llgo:link (*UnicodeObject).AsUCS4Copy C.PyUnicode_AsUCS4Copy

func (*UnicodeObject) AsUTF8 added in v0.2.3

func (self *UnicodeObject) AsUTF8() *c.Char

Returns a pointer to the default encoding (UTF-8) of the Unicode object unicode.

Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation in the unicodeobject.

_PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to support the previous internal function with the same behaviour.

Use of this API is DEPRECATED since no size information can be extracted from the returned data.

llgo:link (*UnicodeObject).AsUTF8 C.PyUnicode_AsUTF8

func (*UnicodeObject) AsUTF8AndSize added in v0.2.3

func (self *UnicodeObject) AsUTF8AndSize(size *SsizeT) *c.Char

llgo:link (*UnicodeObject).AsUTF8AndSize C.PyUnicode_AsUTF8AndSize

func (*UnicodeObject) AsUTF8String added in v0.2.3

func (self *UnicodeObject) AsUTF8String() *Object

llgo:link (*UnicodeObject).AsUTF8String C.PyUnicode_AsUTF8String

func (*UnicodeObject) AsUTF16String added in v0.2.3

func (self *UnicodeObject) AsUTF16String() *Object

Returns a Python string using the UTF-16 encoding in native byte order. The string always starts with a BOM mark.

llgo:link (*UnicodeObject).AsUTF16String C.PyUnicode_AsUTF16String

func (*UnicodeObject) AsUTF32String added in v0.2.3

func (self *UnicodeObject) AsUTF32String() *Object

Returns a Python string using the UTF-32 encoding in native byte order. The string always starts with a BOM mark.

llgo:link (*UnicodeObject).AsUTF32String C.PyUnicode_AsUTF32String

func (*UnicodeObject) AsUnicodeEscapeString added in v0.2.3

func (self *UnicodeObject) AsUnicodeEscapeString() *Object

llgo:link (*UnicodeObject).AsUnicodeEscapeString C.PyUnicode_AsUnicodeEscapeString

func (*UnicodeObject) AsWideChar added in v0.2.3

func (self *UnicodeObject) AsWideChar(w *c.WcharT, size SsizeT) SsizeT

Copies the Unicode Object contents into the wchar_t buffer w. At most size wchar_t characters are copied.

Note that the resulting wchar_t string may or may not be 0-terminated. It is the responsibility of the caller to make sure that the wchar_t string is 0-terminated in case this is required by the application.

Returns the number of wchar_t characters copied (excluding a possibly trailing 0-termination character) or -1 in case of an error.

llgo:link (*UnicodeObject).AsWideChar C.PyUnicode_AsWideChar

func (*UnicodeObject) AsWideCharString added in v0.2.3

func (self *UnicodeObject) AsWideCharString(size *SsizeT) *c.WcharT

Convert the Unicode object to a wide character string. The output string always ends with a nul character. If size is not NULL, write the number of wide characters (excluding the null character) into *size.

Returns a buffer allocated by PyMem_Malloc() (use PyMem_Free() to free it) on success. On error, returns NULL, *size is undefined and raises a MemoryError.

llgo:link (*UnicodeObject).AsWideCharString C.PyUnicode_AsWideCharString

func (*UnicodeObject) BuildEncodingMap added in v0.2.3

func (self *UnicodeObject) BuildEncodingMap() *Object

Build an encoding map.

llgo:link (*UnicodeObject).BuildEncodingMap C.PyUnicode_BuildEncodingMap

func (*UnicodeObject) Compare added in v0.2.3

func (self *UnicodeObject) Compare(right *Object) c.Int

Compare two strings and return -1, 0, 1 for less than, equal, greater than resp. Raise an exception and return -1 on error.

llgo:link (*UnicodeObject).Compare C.PyUnicode_Compare

func (*UnicodeObject) CompareWithASCIIString added in v0.2.3

func (self *UnicodeObject) CompareWithASCIIString(right *c.Char) c.Int

Compare a Unicode object with C string and return -1, 0, 1 for less than, equal, and greater than, respectively. It is best to pass only ASCII-encoded strings, but the function interprets the input string as ISO-8859-1 if it contains non-ASCII characters. This function does not raise exceptions.

llgo:link (*UnicodeObject).CompareWithASCIIString C.PyUnicode_CompareWithASCIIString

func (*UnicodeObject) Concat added in v0.2.3

func (self *UnicodeObject) Concat(right *Object) *Object

Concat two strings giving a new Unicode string.

llgo:link (*UnicodeObject).Concat C.PyUnicode_Concat

func (*UnicodeObject) Contains added in v0.2.3

func (self *UnicodeObject) Contains(element *Object) c.Int

Checks whether element is contained in container and return 1/0 accordingly.

element has to coerce to a one element Unicode string. -1 is returned in case of an error.

llgo:link (*UnicodeObject).Contains C.PyUnicode_Contains

func (*UnicodeObject) CopyCharacters added in v0.2.3

func (self *UnicodeObject) CopyCharacters(to_start SsizeT, from *Object, from_start SsizeT, how_many SsizeT) SsizeT

Copy character from one unicode object into another, this function performs character conversion when necessary and falls back to memcpy() if possible.

Fail if to is too small (smaller than *how_many* or smaller than len(from)-from_start), or if kind(from[from_start:from_start+how_many]) > kind(to), or if *to* has more than 1 reference.

Return the number of written character, or return -1 and raise an exception on error.

Pseudo-code:

how_many = min(how_many, len(from) - from_start) to[to_start:to_start+how_many] = from[from_start:from_start+how_many] return how_many

Note: The function doesn't write a terminating null character.

llgo:link (*UnicodeObject).CopyCharacters C.PyUnicode_CopyCharacters

func (*UnicodeObject) Count added in v0.2.3

func (self *UnicodeObject) Count(substr *Object, start SsizeT, end SsizeT) SsizeT

Count the number of occurrences of substr in str[start:end].

llgo:link (*UnicodeObject).Count C.PyUnicode_Count

func (*UnicodeObject) EncodeFSDefault added in v0.2.3

func (self *UnicodeObject) EncodeFSDefault() *Object

Encode a Unicode object to the Python filesystem encoding and error handler. Return bytes.

llgo:link (*UnicodeObject).EncodeFSDefault C.PyUnicode_EncodeFSDefault

func (*UnicodeObject) EncodeLocale added in v0.2.3

func (self *UnicodeObject) EncodeLocale(errors *c.Char) *Object

Encode a Unicode object to the current locale encoding. The encoder is strict is *surrogateescape* is equal to zero, otherwise the "surrogateescape" error handler is used. Return a bytes object. The string cannot contain embedded null characters.

llgo:link (*UnicodeObject).EncodeLocale C.PyUnicode_EncodeLocale

func (*UnicodeObject) Equal added in v0.2.3

func (self *UnicodeObject) Equal(str2 *Object) c.Int

llgo:link (*UnicodeObject).Equal C.PyUnicode_Equal

func (*UnicodeObject) EqualToUTF8 added in v0.2.3

func (self *UnicodeObject) EqualToUTF8(_llcppg_param2 *c.Char) c.Int

Compare a Unicode object with UTF-8 encoded C string. Return 1 if they are equal, or 0 otherwise. This function does not raise exceptions.

llgo:link (*UnicodeObject).EqualToUTF8 C.PyUnicode_EqualToUTF8

func (*UnicodeObject) EqualToUTF8AndSize added in v0.2.3

func (self *UnicodeObject) EqualToUTF8AndSize(_llcppg_param2 *c.Char, _llcppg_param3 SsizeT) c.Int

llgo:link (*UnicodeObject).EqualToUTF8AndSize C.PyUnicode_EqualToUTF8AndSize

func (*UnicodeObject) FSConverter added in v0.2.3

func (self *UnicodeObject) FSConverter(_llcppg_param2 unsafe.Pointer) c.Int

ParseTuple converter: encode str objects to bytes using PyUnicode_EncodeFSDefault(); bytes objects are output as-is.

llgo:link (*UnicodeObject).FSConverter C.PyUnicode_FSConverter

func (*UnicodeObject) FSDecoder added in v0.2.3

func (self *UnicodeObject) FSDecoder(_llcppg_param2 unsafe.Pointer) c.Int

ParseTuple converter: decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is.

llgo:link (*UnicodeObject).FSDecoder C.PyUnicode_FSDecoder

func (*UnicodeObject) Fill added in v0.2.3

func (self *UnicodeObject) Fill(start SsizeT, length SsizeT, fill_char UCS4) SsizeT

Fill a string with a character: write fill_char into unicode[start:start+length].

Fail if fill_char is bigger than the string maximum character, or if the string has more than 1 reference.

Return the number of written character, or return -1 and raise an exception on error.

llgo:link (*UnicodeObject).Fill C.PyUnicode_Fill

func (*UnicodeObject) Find added in v0.2.3

func (self *UnicodeObject) Find(substr *Object, start SsizeT, end SsizeT, direction c.Int) SsizeT

Return the first position of substr in str[start:end] using the given search direction or -1 if not found. -2 is returned in case an error occurred and an exception is set.

llgo:link (*UnicodeObject).Find C.PyUnicode_Find

func (*UnicodeObject) FindChar added in v0.2.3

func (self *UnicodeObject) FindChar(ch UCS4, start SsizeT, end SsizeT, direction c.Int) SsizeT

Like PyUnicode_Find, but search for single character only.

llgo:link (*UnicodeObject).FindChar C.PyUnicode_FindChar

func (*UnicodeObject) Format added in v0.2.3

func (self *UnicodeObject) Format(args *Object) *Object

Apply an argument tuple or dictionary to a format string and return the resulting Unicode string.

llgo:link (*UnicodeObject).Format C.PyUnicode_Format

func (*UnicodeObject) IsIdentifier added in v0.2.3

func (self *UnicodeObject) IsIdentifier() c.Int

Checks whether argument is a valid identifier.

llgo:link (*UnicodeObject).IsIdentifier C.PyUnicode_IsIdentifier

func (*UnicodeObject) Join added in v0.2.3

func (self *UnicodeObject) Join(seq *Object) *Object

Join a sequence of strings using the given separator and return the resulting Unicode string.

llgo:link (*UnicodeObject).Join C.PyUnicode_Join

func (*UnicodeObject) Length added in v0.2.3

func (self *UnicodeObject) Length() SsizeT

Get the length of the Unicode object.

llgo:link (*UnicodeObject).Length C.PyUnicode_GetLength

func (*UnicodeObject) Partition added in v0.2.3

func (self *UnicodeObject) Partition(sep *Object) *Object

Partition a string using a given separator.

llgo:link (*UnicodeObject).Partition C.PyUnicode_Partition

func (*UnicodeObject) RPartition added in v0.2.3

func (self *UnicodeObject) RPartition(sep *Object) *Object

Partition a string using a given separator, searching from the end of the string.

llgo:link (*UnicodeObject).RPartition C.PyUnicode_RPartition

func (*UnicodeObject) RSplit added in v0.2.3

func (self *UnicodeObject) RSplit(sep *Object, maxsplit SsizeT) *Object

Split a string giving a list of Unicode strings.

If sep is NULL, splitting will be done at all whitespace substrings. Otherwise, splits occur at the given separator.

At most maxsplit splits will be done. But unlike PyUnicode_Split PyUnicode_RSplit splits from the end of the string. If negative, no limit is set.

Separators are not included in the resulting list.

llgo:link (*UnicodeObject).RSplit C.PyUnicode_RSplit

func (*UnicodeObject) ReadChar added in v0.2.3

func (self *UnicodeObject) ReadChar(index SsizeT) UCS4

Read a character from the string.

llgo:link (*UnicodeObject).ReadChar C.PyUnicode_ReadChar

func (*UnicodeObject) Replace added in v0.2.3

func (self *UnicodeObject) Replace(substr *Object, replstr *Object, maxcount SsizeT) *Object

Replace at most maxcount occurrences of substr in str with replstr and return the resulting Unicode object.

llgo:link (*UnicodeObject).Replace C.PyUnicode_Replace

func (*UnicodeObject) RichCompare added in v0.2.3

func (self *UnicodeObject) RichCompare(right *Object, op c.Int) *Object

Rich compare two strings and return one of the following:

- NULL in case an exception was raised - Py_True or Py_False for successful comparisons - Py_NotImplemented in case the type combination is unknown

Possible values for op:

Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE

llgo:link (*UnicodeObject).RichCompare C.PyUnicode_RichCompare

func (*UnicodeObject) Split added in v0.2.3

func (self *UnicodeObject) Split(sep *Object, maxsplit SsizeT) *Object

Split a string giving a list of Unicode strings.

If sep is NULL, splitting will be done at all whitespace substrings. Otherwise, splits occur at the given separator.

At most maxsplit splits will be done. If negative, no limit is set.

Separators are not included in the resulting list.

llgo:link (*UnicodeObject).Split C.PyUnicode_Split

func (*UnicodeObject) Splitlines added in v0.2.3

func (self *UnicodeObject) Splitlines(keepends c.Int) *Object

Dito, but split at line breaks.

CRLF is considered to be one line break. Line breaks are not included in the resulting list.

llgo:link (*UnicodeObject).Splitlines C.PyUnicode_Splitlines

func (*UnicodeObject) Substring added in v0.2.3

func (self *UnicodeObject) Substring(start SsizeT, end SsizeT) *Object

llgo:link (*UnicodeObject).Substring C.PyUnicode_Substring

func (*UnicodeObject) Tailmatch added in v0.2.3

func (self *UnicodeObject) Tailmatch(substr *Object, start SsizeT, end SsizeT, direction c.Int) SsizeT

Return 1 if substr matches str[start:end] at the given tail end, 0 otherwise.

llgo:link (*UnicodeObject).Tailmatch C.PyUnicode_Tailmatch

func (*UnicodeObject) Translate added in v0.2.3

func (self *UnicodeObject) Translate(table *Object, errors *c.Char) *Object

Translate a string by applying a character mapping table to it and return the resulting Unicode object.

The mapping table must map Unicode ordinal integers to Unicode strings, Unicode ordinal integers or None (causing deletion of the character).

Mapping tables may be dictionaries or sequences. Unmapped character ordinals (ones which cause a LookupError) are left untouched and are copied as-is.

llgo:link (*UnicodeObject).Translate C.PyUnicode_Translate

func (*UnicodeObject) Unicode_DATA added in v0.2.3

func (self *UnicodeObject) Unicode_DATA() unsafe.Pointer

llgo:link (*UnicodeObject).Unicode_DATA C.PyUnicode_DATA

func (*UnicodeObject) Unicode_KIND added in v0.2.3

func (self *UnicodeObject) Unicode_KIND() c.Int

llgo:link (*UnicodeObject).Unicode_KIND C.PyUnicode_KIND

func (*UnicodeObject) WriteChar added in v0.2.3

func (self *UnicodeObject) WriteChar(index SsizeT, character UCS4) c.Int

Write a character to the string. The string must have been created through PyUnicode_New, must not be shared, and must not have been hashed yet.

Return 0 on success, -1 on error.

llgo:link (*UnicodeObject).WriteChar C.PyUnicode_WriteChar

type UnicodeWriter added in v0.2.0

type UnicodeWriter struct {
}

func UnicodeWriterCreate added in v0.2.0

func UnicodeWriterCreate(length SsizeT) *UnicodeWriter

type VarObject added in v0.2.0

type VarObject struct {
	ObBase Object
	ObSize SsizeT
}

func X_ObjectNewVar added in v0.2.0

func X_ObjectNewVar(_llcppg_param1 *TypeObject, _llcppg_param2 SsizeT) *VarObject

func X_Object_GC_NewVar added in v0.2.0

func X_Object_GC_NewVar(_llcppg_param1 *TypeObject, _llcppg_param2 SsizeT) *VarObject

func X_Object_GC_Resize added in v0.2.0

func X_Object_GC_Resize(_llcppg_param1 *VarObject, _llcppg_param2 SsizeT) *VarObject

func (*VarObject) ObjectInit added in v0.2.3

func (self *VarObject) ObjectInit(_llcppg_param2 *TypeObject, _llcppg_param3 SsizeT) *VarObject

llgo:link (*VarObject).ObjectInit C.PyObject_InitVar

type Vectorcallfunc

type Vectorcallfunc = func(_llcppg_param1 *Object, _llcppg_param2 **Object, _llcppg_param3 c.SizeT, _llcppg_param4 *Object) *Object

llgo:type C

func VectorcallFunction added in v0.2.3

func VectorcallFunction(callable *Object) Vectorcallfunc

type Visitproc

type Visitproc = func(_llcppg_param1 *Object, _llcppg_param2 unsafe.Pointer) c.Int

llgo:type C

type WeakReference added in v0.2.0

type WeakReference = X_WeakReference

type WideStringList added in v0.2.0

type WideStringList struct {
	Length SsizeT
	Items  **c.WcharT
}

--- PyWideStringList ------------------------------------------------

type WrapperDescrObject added in v0.2.0

type WrapperDescrObject struct {
	DCommon  DescrObject
	DBase    *Wrapperbase
	DWrapped unsafe.Pointer
}

type Wrapperbase

type Wrapperbase struct {
	Name       *c.Char
	Offset     c.Int
	Function   unsafe.Pointer
	Wrapper    Wrapperfunc
	Doc        *c.Char
	Flags      c.Int
	NameStrobj *Object
}

type Wrapperfunc

type Wrapperfunc = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 unsafe.Pointer) *Object

llgo:type C

type WrapperfuncKwds

type WrapperfuncKwds = func(_llcppg_param1 *Object, _llcppg_param2 *Object, _llcppg_param3 unsafe.Pointer, _llcppg_param4 *Object) *Object

llgo:type C

type X_ArgParser added in v0.2.0

type X_ArgParser struct {
	Format         *c.Char
	Keywords       **c.Char
	Fname          *c.Char
	CustomMsg      *c.Char
	Once           X_OnceFlag
	IsKwtupleOwned c.Int
	Pos            c.Int
	Min            c.Int
	Max            c.Int
	Kwtuple        *Object
	Next           *X_ArgParser
}

type X_AsyncGenObject added in v0.2.0

type X_AsyncGenObject struct {
}

type X_CFunctionFast added in v0.2.0

type X_CFunctionFast = CFunctionFast

For backwards compatibility. `METH_FASTCALL` was added to the stable API in 3.10 alongside `_PyCFunctionFastWithKeywords` and `_PyCFunctionFast`. Note that the underscore-prefixed names were documented in public docs; people may be using them.

type X_CFunctionFastWithKeywords added in v0.2.0

type X_CFunctionFastWithKeywords = CFunctionFastWithKeywords

type X_CoCached added in v0.2.0

type X_CoCached struct {
	X_coCode     *Object
	X_coVarnames *Object
	X_coCellvars *Object
	X_coFreevars *Object
}

type X_CoMonitoringData added in v0.2.0

type X_CoMonitoringData struct {
}

type X_CodeLocationInfoKind added in v0.2.0

type X_CodeLocationInfoKind c.Uint
const (
	// short forms are 0 to 9
	CODE_LOCATION_INFO_SHORT0 X_CodeLocationInfoKind = 0
	// one lineforms are 10 to 12
	CODE_LOCATION_INFO_ONE_LINE0 X_CodeLocationInfoKind = 10
	// one lineforms are 10 to 12
	CODE_LOCATION_INFO_ONE_LINE1 X_CodeLocationInfoKind = 11
	// one lineforms are 10 to 12
	CODE_LOCATION_INFO_ONE_LINE2 X_CodeLocationInfoKind = 12
	// one lineforms are 10 to 12
	CODE_LOCATION_INFO_NO_COLUMNS X_CodeLocationInfoKind = 13
	// one lineforms are 10 to 12
	CODE_LOCATION_INFO_LONG X_CodeLocationInfoKind = 14
	// one lineforms are 10 to 12
	CODE_LOCATION_INFO_NONE X_CodeLocationInfoKind = 15
)

type X_CoroObject added in v0.2.0

type X_CoroObject struct {
}

type X_ErrStackItem added in v0.2.0

type X_ErrStackItem = X_errStackitem

type X_ExecutorArray added in v0.2.0

type X_ExecutorArray struct {
	Size      c.Int
	Capacity  c.Int
	Executors [1]*X_ExecutorObject
}

type X_ExecutorObject added in v0.2.0

type X_ExecutorObject struct {
}

type X_FrameEvalFunction added in v0.2.0

type X_FrameEvalFunction = func(_llcppg_param1 *ThreadState, _llcppg_param2 *X_InterpreterFrame, _llcppg_param3 c.Int) *Object

Frame evaluation API

llgo:type C

func X_InterpreterStateGetEvalFrameFunc added in v0.2.0

func X_InterpreterStateGetEvalFrameFunc(interp *InterpreterState) X_FrameEvalFunction

type X_GenObject added in v0.2.0

type X_GenObject struct {
}

type X_Identifier added in v0.2.0

type X_Identifier struct {
	String *c.Char
	Index  SsizeT
	Mutex  _llcppg_anon_1
}

String Literals This structure helps managing static strings. The basic usage goes like this: Instead of doing

r = PyObject_CallMethod(o, "foo", "args", ...);

do

_Py_IDENTIFIER(foo); ... r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);

PyId_foo is a static variable, either on block level or file level. On first usage, the string "foo" is interned, and the structures are linked. On interpreter shutdown, all strings are released.

Alternatively, _Py_static_string allows choosing the variable name. _PyUnicode_FromId returns a borrowed reference to the interned string. _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.

type X_InterpreterFrame added in v0.2.0

type X_InterpreterFrame struct {
}

type X_LongValue added in v0.2.0

type X_LongValue struct {
	LvTag   c.UintptrT
	ObDigit [1]Digit
}

Long integer representation.

Long integers are made up of a number of 30- or 15-bit digits, depending on the platform. The number of digits (ndigits) is stored in the high bits of the lv_tag field (lvtag >> _PyLong_NON_SIZE_BITS).

The absolute value of a number is equal to SUM(for i=0 through ndigits-1) ob_digit[i] * 2**(PyLong_SHIFT*i)

The sign of the value is stored in the lower 2 bits of lv_tag.

- 0: Positive - 1: Zero - 2: Negative

The third lowest bit of lv_tag is set to 1 for the small ints.

In a normalized number, ob_digit[ndigits-1] (the most significant digit) is never zero. Also, in all cases, for all valid i, 0 <= ob_digit[i] <= PyLong_MASK.

The allocation function takes care of allocating extra memory so that ob_digit[0] ... ob_digit[ndigits-1] are actually available. We always allocate memory for at least one digit, so accessing ob_digit[0] is always safe. However, in the case ndigits == 0, the contents of ob_digit[0] may be undefined.

type X_ManagedBufferObject added in v0.2.0

type X_ManagedBufferObject struct {
	ObBase  Object
	Flags   c.Int
	Exports SsizeT
	Master  Buffer
}

type X_MonitoringState added in v0.2.0

type X_MonitoringState struct {
	Active c.Uint8T
	Opaque c.Uint8T
}

type X_OnceFlag added in v0.2.0

type X_OnceFlag struct {
	V c.Uint8T
}

A data structure that can be used to run initialization code once in a thread-safe manner. The C++11 equivalent is std::call_once.

type X_RemoteDebuggerSupport added in v0.2.0

type X_RemoteDebuggerSupport struct {
	DebuggerPendingCall c.Int32T
	DebuggerScriptPath  [512]c.Char
}

type X_StackChunk added in v0.2.0

type X_StackChunk = X_stackChunk

type X_UnicodeWriter added in v0.2.0

type X_UnicodeWriter struct {
	Buffer       *Object
	Data         unsafe.Pointer
	Kind         c.Int
	Maxchar      UCS4
	Size         SsizeT
	Pos          SsizeT
	MinLength    SsizeT
	MinChar      UCS4
	Overallocate uint8
	Readonly     uint8
}

--- Private _PyUnicodeWriter API ---------------------------------------

type X_WeakReference added in v0.2.0

type X_WeakReference struct {
	ObBase     Object
	WrObject   *Object
	WrCallback *Object
	Hash       HashT
	WrPrev     *WeakReference
	WrNext     *WeakReference
	Vectorcall Vectorcallfunc
}

PyWeakReference is the base struct for the Python ReferenceType, ProxyType, and CallableProxyType.

type X_dictkeysobject

type X_dictkeysobject struct {
}

type X_dictvalues

type X_dictvalues struct {
}

type X_errStackitem

type X_errStackitem struct {
	ExcValue     *Object
	PreviousItem *X_errStackitem
}

type X_frame

type X_frame struct {
}

type X_frozen

type X_frozen struct {
	Name      *c.Char
	Code      *uint8
	Size      c.Int
	IsPackage c.Int
}
var ImportFrozenModules *X_frozen

Embedding apps may change this pointer to point to their favorite collection of frozen modules:

type X_heaptypeobject

type X_heaptypeobject struct {
	HtType       TypeObject
	AsAsync      AsyncMethods
	AsNumber     NumberMethods
	AsMapping    MappingMethods
	AsSequence   SequenceMethods
	AsBuffer     BufferProcs
	HtName       *Object
	HtSlots      *Object
	HtQualname   *Object
	HtCachedKeys *X_dictkeysobject
	HtModule     *Object
	X_htTpname   *c.Char
	HtToken      unsafe.Pointer
	X_specCache  X_specializationCache
}

The *real* layout of a type object when allocated on the heap

type X_inittab

type X_inittab struct {
	Name     *c.Char
	Initfunc func() *Object
}

llgo:type C

var ImportInittab *X_inittab

This is not used after Py_Initialize() is called.

type X_is

type X_is struct {
}

type X_lineOffsets

type X_lineOffsets struct {
	ArStart c.Int
	ArEnd   c.Int
	ArLine  c.Int
	Opaque  X_opaque
}

type X_longobject

type X_longobject struct {
	ObBase    Object
	LongValue X_LongValue
}

type X_object

type X_object struct {
	ObType *TypeObject
	// contains filtered or unexported fields
}

func (*X_object) XGof_ref_ob_refcnt_full

func (p *X_object) XGof_ref_ob_refcnt_full() *c.Int64T

type X_odictobject

type X_odictobject struct {
}

type X_opaque

type X_opaque struct {
	ComputedLine c.Int
	LoNext       *c.Uint8T
	Limit        *c.Uint8T
}

for internal use only

type X_pycontextobject

type X_pycontextobject struct {
}

type X_pycontexttokenobject

type X_pycontexttokenobject struct {
}

type X_pycontextvarobject

type X_pycontextvarobject struct {
}

type X_specializationCache

type X_specializationCache struct {
	Getitem        *Object
	GetitemVersion c.Uint32T
	Init           *Object
}

This struct is used by the specializer It should be treated as an opaque blob by code other than the specializer and interpreter.

type X_stackChunk

type X_stackChunk struct {
	Previous *X_stackChunk
	Size     c.SizeT
	Top      c.SizeT
	Data     [1]*Object
}

type X_traceback

type X_traceback struct {
	ObBase   Object
	TbNext   *TracebackObject
	TbFrame  *FrameObject
	TbLasti  c.Int
	TbLineno c.Int
}

type X_ts

type X_ts struct {
	Prev                         *ThreadState
	Next                         *ThreadState
	Interp                       *InterpreterState
	EvalBreaker                  c.UintptrT
	X_status                     _llcppg_anon_5
	HoldsGil                     c.Int
	X_whence                     c.Int
	State                        c.Int
	PyRecursionRemaining         c.Int
	PyRecursionLimit             c.Int
	RecursionHeadroom            c.Int
	Tracing                      c.Int
	WhatEvent                    c.Int
	CurrentFrame                 *X_InterpreterFrame
	CProfilefunc                 Tracefunc
	CTracefunc                   Tracefunc
	CProfileobj                  *Object
	CTraceobj                    *Object
	CurrentException             *Object
	ExcInfo                      *X_ErrStackItem
	Dict                         *Object
	GilstateCounter              c.Int
	AsyncExc                     *Object
	ThreadId                     c.Ulong
	NativeThreadId               c.Ulong
	DeleteLater                  *Object
	CriticalSection              c.UintptrT
	CoroutineOriginTrackingDepth c.Int
	AsyncGenFirstiter            *Object
	AsyncGenFinalizer            *Object
	Context                      *Object
	ContextVer                   c.Uint64T
	Id                           c.Uint64T
	DatastackChunk               *X_StackChunk
	DatastackTop                 **Object
	DatastackLimit               **Object
	ExcState                     X_ErrStackItem
	CurrentExecutor              *Object
	DictGlobalVersion            c.Uint64T
	ThreadingLocalKey            *Object
	ThreadingLocalSentinel       *Object
	RemoteDebuggerSupport        X_RemoteDebuggerSupport
	DatastackCachedChunk         *X_StackChunk
}

type X_tssT added in v0.2.0

type X_tssT struct {
	X_isInitialized c.Int
	X_key           pthread.Key
}

When Py_LIMITED_API is not defined, the type layout of Py_tss_t is exposed to allow static allocation in the API clients. Even in this case, you must handle TSS keys through API functions due to compatibility.

type X_typeobject

type X_typeobject struct {
	ObBase             VarObject
	TpName             *c.Char
	TpBasicsize        SsizeT
	TpItemsize         SsizeT
	TpDealloc          Destructor
	TpVectorcallOffset SsizeT
	TpGetattr          Getattrfunc
	TpSetattr          Setattrfunc
	TpAsAsync          *AsyncMethods
	TpRepr             Reprfunc
	TpAsNumber         *NumberMethods
	TpAsSequence       *SequenceMethods
	TpAsMapping        *MappingMethods
	TpHash             Hashfunc
	TpCall             Ternaryfunc
	TpStr              Reprfunc
	TpGetattro         Getattrofunc
	TpSetattro         Setattrofunc
	TpAsBuffer         *BufferProcs
	TpFlags            c.Ulong
	TpDoc              *c.Char
	TpTraverse         Traverseproc
	TpClear            Inquiry
	TpRichcompare      Richcmpfunc
	TpWeaklistoffset   SsizeT
	TpIter             Getiterfunc
	TpIternext         Iternextfunc
	TpMethods          *MethodDef
	TpMembers          *MemberDef
	TpGetset           *GetSetDef
	TpBase             *TypeObject
	TpDict             *Object
	TpDescrGet         Descrgetfunc
	TpDescrSet         Descrsetfunc
	TpDictoffset       SsizeT
	TpInit             Initproc
	TpAlloc            Allocfunc
	TpNew              Newfunc
	TpFree             Freefunc
	TpIsGc             Inquiry
	TpBases            *Object
	TpMro              *Object
	TpCache            *Object
	TpSubclasses       unsafe.Pointer
	TpWeaklist         *Object
	TpDel              Destructor
	TpVersionTag       c.Uint
	TpFinalize         Destructor
	TpVectorcall       Vectorcallfunc
	TpWatched          uint8
	TpVersionsUsed     c.Uint16T
}

If this structure is modified, Doc/includes/typestruct.h should be updated as well.

Jump to

Keyboard shortcuts

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