C# Class Python.Runtime.PyList

Represents a standard Python list object. See the documentation at http://www.python.org/doc/current/api/listObjects.html for details.
Inheritance: PySequence
Show file Open project: fkarb/pythonnet Class Usage Examples

Public Methods

Method Description
Append ( PyObject item ) : void

Append Method

Append an item to the list object.

AsList ( PyObject value ) : PyList

AsList Method

Converts a Python object to a Python list if possible, raising a PythonException if the conversion is not possible. This is equivalent to the Python expression "list(object)".

Insert ( int index, PyObject item ) : void

Insert Method

Insert an item in the list object at the given index.

IsListType ( PyObject value ) : bool

IsListType Method

Returns true if the given object is a Python list.

PyList ( ) : System

PyList Constructor

Creates a new empty Python list object.

PyList ( IntPtr ptr ) : System

PyList Constructor

Creates a new PyList from an existing object reference. Note that the instance assumes ownership of the object reference. The object reference is not checked for type-correctness.

PyList ( PyObject o ) : System

PyList Constructor

Copy constructor - obtain a PyList from a generic PyObject. An ArgumentException will be thrown if the given object is not a Python list object.

Reverse ( ) : void

Reverse Method

Reverse the order of the list object in place.

Sort ( ) : void

Sort Method

Sort the list in place.

Method Details

Append() public method

Append Method
Append an item to the list object.
public Append ( PyObject item ) : void
item PyObject
return void

AsList() public static method

AsList Method
Converts a Python object to a Python list if possible, raising a PythonException if the conversion is not possible. This is equivalent to the Python expression "list(object)".
public static AsList ( PyObject value ) : PyList
value PyObject
return PyList

Insert() public method

Insert Method
Insert an item in the list object at the given index.
public Insert ( int index, PyObject item ) : void
index int
item PyObject
return void

IsListType() public static method

IsListType Method
Returns true if the given object is a Python list.
public static IsListType ( PyObject value ) : bool
value PyObject
return bool

PyList() public method

PyList Constructor
Creates a new empty Python list object.
public PyList ( ) : System
return System

PyList() public method

PyList Constructor
Creates a new PyList from an existing object reference. Note that the instance assumes ownership of the object reference. The object reference is not checked for type-correctness.
public PyList ( IntPtr ptr ) : System
ptr System.IntPtr
return System

PyList() public method

PyList Constructor
Copy constructor - obtain a PyList from a generic PyObject. An ArgumentException will be thrown if the given object is not a Python list object.
public PyList ( PyObject o ) : System
o PyObject
return System

Reverse() public method

Reverse Method
Reverse the order of the list object in place.
public Reverse ( ) : void
return void

Sort() public method

Sort Method
Sort the list in place.
public Sort ( ) : void
return void