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. | |
Functions that operate on Python tuple objects.
| 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.
| key | REPY_Handle argument for the first entry in the tuple. |
| value | REPY_Handle argument for the second entry in the tuple. |
| 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.
| key | REPY_Handle argument for the first entry in the tuple. |
| value | REPY_Handle argument for the second entry in the tuple. |
| 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.
| key | REPY_Handle argument for the first entry in the tuple. |
| value | REPY_Handle argument for the second entry in the tuple. |
| 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.
| key | REPY_Handle argument for the first entry in the tuple. |
| value | REPY_Handle argument for the second entry in the tuple. |
| 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.
| size | The 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. |
| 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.
| size | The 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. |
| 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.
| tuple | The tuple to get an object from. |
| index | The index of the desired object. |