CVB PyScript object (variant-like Python object).
More...
Inherits INativeHandle.
|
|
int | ElementCount [get] |
| | Gets the element count (valid for list/tuple only).
|
| |
|
IntPtr | Handle [get] |
| | Native handle of the object.
|
| |
|
bool | IsDisposed [get] |
| | Gets if the native handle has been disposed.
|
| |
CVB PyScript object (variant-like Python object).
◆ As< T >()
Interprets the object as a type.
- Returns
- The requested type if contained within the object.
◆ Create< T >()
Creates a PythonObject from the given value. Supports strings, CVB handles, primitives, and CVB value-type structs.
- Parameters
-
| value | The object to put into the python object. |
- Template Parameters
-
| T | The type of the object to put into the python object. |
- Returns
- The newly created python object.
◆ CreateNone()
Creates a Python 'None' object.
- Returns
- None python object.
◆ GetElement()
Gets a tuple/list element by index.
- Parameters
-
| index | Index of the object to get. |
◆ MakeTuple()
◆ MakeVoidTuple()
Creates a tuple object pre-sized with None entries.
- Parameters
-
| size | Size of the tuple to create. |
- Returns
- Empty tuple with the given size .
See SetElement(int, PythonObject), GetElement(int) and ElementCount for handling the items in the tuple.
- Exceptions
-
| ArgumentOutOfRangeException | When size smaller 0. |
◆ Run() [1/2]
Runs this object as a callable without arguments.
- Returns
- The result of the call as a PythonObject (may be "None").
◆ Run() [2/2]
Runs this object as a callable with a tuple of arguments.
- Parameters
-
| args | Arguments for the call. Must be a tuple. |
- Returns
- The result of the call as a PythonObject (may be "None").
◆ SetElement()
Sets a tuple/list element by index.
- Parameters
-
| index | Index to set. |
| value | Object to set at the given index . |
◆ ObjectDisposing
Raised when this object is about to be disposed via the IDisposable.Dispose method.
This event is raised right before this object is disposed. The dispose itself cannot be canceled.