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
Afficher le fichier Open project: fkarb/pythonnet Class Usage Examples

Méthodes publiques

Méthode 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 méthode

Append Method
Append an item to the list object.
public Append ( PyObject item ) : void
item PyObject
Résultat void

AsList() public static méthode

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
Résultat PyList

Insert() public méthode

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

IsListType() public static méthode

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

PyList() public méthode

PyList Constructor
Creates a new empty Python list object.
public PyList ( ) : System
Résultat System

PyList() public méthode

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
Résultat System

PyList() public méthode

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
Résultat System

Reverse() public méthode

Reverse Method
Reverse the order of the list object in place.
public Reverse ( ) : void
Résultat void

Sort() public méthode

Sort Method
Sort the list in place.
public Sort ( ) : void
Résultat void