RecompExternalPython for N64Recompiled 2.0.0
Loading...
Searching...
No Matches

Functions that operate on Python tuple objects. More...

Functions

REPY_Handle REPY_CreateTuple (REPY_u32 size,...)
 Create a Python tuple and return a REPY_Handle for it.
REPY_Handle REPY_CreateTuple_SUH (REPY_u32 size,...)
 Create a Python tuple and return a Single-Use REPY_Handle for it.
REPY_Handle REPY_CreatePair (REPY_Handle key, REPY_Handle value)
 Create a Python tuple with exactly 2 entries and return a REPY_Handle for it.
REPY_Handle REPY_CreatePair_SUH (REPY_Handle key, REPY_Handle value)
 Create a Python tuple with exactly 2 entries and return a Single-Use REPY_Handle for it.
REPY_Handle REPY_CreatePairCStr (char *key, REPY_Handle value)
 Create a Python tuple with exactly 2 entries and return a REPY_Handle for it. The first entry is automatically cast to str.
REPY_Handle REPY_CreatePairCStr_SUH (char *key, REPY_Handle value)
 Create a Python tuple with exactly 2 entries and return a Single-Use REPY_Handle for it. The first entry is automatically cast to str.
REPY_Handle REPY_TupleGetIndexS32 (REPY_Handle tuple, int index)
 Returns the Python object at a specific index from a tuple.

Detailed Description

Functions that operate on Python tuple objects.

Function Documentation

◆ REPY_CreatePair()

REPY_Handle REPY_CreatePair ( REPY_Handle key,
REPY_Handle value )

Create a Python tuple with exactly 2 entries and return a REPY_Handle for it.

Used primarily for constucting key/value pairs when calling REPY_CreateDict. However, because the REPY_Handle created by this function requires manual release, it's not recommended to use this nest a call to this function inside another.

Parameters
keyREPY_Handle argument for the first entry in the tuple.
valueREPY_Handle argument for the second entry in the tuple.
Returns
A REPY_Handle for the new tuple. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CreatePair_SUH()

REPY_Handle REPY_CreatePair_SUH ( REPY_Handle key,
REPY_Handle value )

Create a Python tuple with exactly 2 entries and return a Single-Use REPY_Handle for it.

Used primarily for constucting key/value pairs when calling REPY_CreateDict. Because the returned handle is Single-Use, this is the recommended function for nesting inside REPY_CreateDict calls.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreatePair(key, value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
keyREPY_Handle argument for the first entry in the tuple.
valueREPY_Handle argument for the second entry in the tuple.
Returns
A REPY_Handle for the new tuple. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CreatePairCStr()

REPY_Handle REPY_CreatePairCStr ( char * key,
REPY_Handle value )

Create a Python tuple with exactly 2 entries and return a REPY_Handle for it. The first entry is automatically cast to str.

Used primarily for constucting key/value pairs when calling REPY_CreateDict. However, because the REPY_Handle created by this function requires manual release, it's not recommended to use this nest a call to this function inside another.

Parameters
keyREPY_Handle argument for the first entry in the tuple.
valueREPY_Handle argument for the second entry in the tuple.
Returns
A REPY_Handle for the new tuple. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CreatePairCStr_SUH()

REPY_Handle REPY_CreatePairCStr_SUH ( char * key,
REPY_Handle value )

Create a Python tuple with exactly 2 entries and return a Single-Use REPY_Handle for it. The first entry is automatically cast to str.

Used primarily for constucting key/value pairs when calling REPY_CreateDict. Because the returned handle is Single-Use, this is the recommended function for nesting inside REPY_CreateDict calls.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreatePair(key, value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
keyREPY_Handle argument for the first entry in the tuple.
valueREPY_Handle argument for the second entry in the tuple.
Returns
A REPY_Handle for the new tuple. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CreateTuple()

REPY_Handle REPY_CreateTuple ( REPY_u32 size,
... )

Create a Python tuple and return a REPY_Handle for it.

Because the REPY_Handle created by this function requires manual release, it's not recommended to use this function nested inside REPY_Call (or any of it's sister functions) to pass positional arguments. Use REPY_CreateTuple_SUH instead.

Parameters
sizeThe number of entries in the tuple. Use 0 for an empty tuple.
...REPY_Handle arguments for each entry in the tuple. Leave out if size is 0.
Returns
A REPY_Handle for the new tuple. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CreateTuple_SUH()

REPY_Handle REPY_CreateTuple_SUH ( REPY_u32 size,
... )

Create a Python tuple and return a Single-Use REPY_Handle for it.

This is the recommended function for constructing a positional arguments tuple nested inside a call to REPY_Call (or any of it's sister functions).

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateTuple(size, ...)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
sizeThe number of entries in the tuple. Use 0 for an empty tuple.
...REPY_Handle arguments for each entry in the tuple. Leave out if size is 0.
Returns
A Single-Use REPY_Handle for the new tuple. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_TupleGetIndexS32()

REPY_Handle REPY_TupleGetIndexS32 ( REPY_Handle tuple,
int index )

Returns the Python object at a specific index from a tuple.

Currently, is a known issue with this interface: Negative index values (which represent the position from the end of the tuple in Python code) do not currently work. This will be fixed in a future update.

Only works with Python tuple objects.

Parameters
tupleThe tuple to get an object from.
indexThe index of the desired object.
Returns
The Python object at index in tuple. Will be REPY_NO_HANDLE if an error occured.