C# Класс Python.Runtime.PyList

Represents a standard Python list object. See the documentation at http://www.python.org/doc/current/api/listObjects.html for details.
Наследование: PySequence
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

Append() публичный Метод

Append Method
Append an item to the list object.
public Append ( PyObject item ) : void
item PyObject
Результат void

AsList() публичный статический Метод

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
Результат PyList

Insert() публичный Метод

Insert Method
Insert an item in the list object at the given index.
public Insert ( int index, PyObject item ) : void
index int
item PyObject
Результат void

IsListType() публичный статический Метод

IsListType Method
Returns true if the given object is a Python list.
public static IsListType ( PyObject value ) : bool
value PyObject
Результат bool

PyList() публичный Метод

PyList Constructor
Creates a new empty Python list object.
public PyList ( ) : System
Результат System

PyList() публичный Метод

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
Результат System

PyList() публичный Метод

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
Результат System

Reverse() публичный Метод

Reverse Method
Reverse the order of the list object in place.
public Reverse ( ) : void
Результат void

Sort() публичный Метод

Sort Method
Sort the list in place.
public Sort ( ) : void
Результат void