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

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

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

Метод Описание
AsInt ( PyObject value ) : PyInt

AsInt Method

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

IsIntType ( PyObject value ) : bool

IsIntType Method

Returns true if the given object is a Python int.

PyInt ( IntPtr ptr ) : System

PyInt Constructor

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

PyInt ( PyObject o ) : System

PyInt Constructor

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

PyInt ( byte value ) : System

PyInt Constructor

Creates a new Python int from a byte value.

PyInt ( int value ) : System

PyInt Constructor

Creates a new Python int from an int32 value.

PyInt ( long value ) : System

PyInt Constructor

Creates a new Python int from an int64 value.

PyInt ( short value ) : System

PyInt Constructor

Creates a new Python int from an int16 value.

PyInt ( string value ) : System

PyInt Constructor

Creates a new Python int from a string value.

ToInt16 ( ) : short

ToInt16 Method

Return the value of the Python int object as an int16.

ToInt32 ( ) : int

ToInt32 Method

Return the value of the Python int object as an int32.

ToInt64 ( ) : long

ToInt64 Method

Return the value of the Python int object as an int64.

Приватные методы

Метод Описание
PyInt ( sbyte value ) : System
PyInt ( uint value ) : System
PyInt ( ulong value ) : System
PyInt ( ushort value ) : System

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

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

AsInt Method
Convert a Python object to a Python int if possible, raising a PythonException if the conversion is not possible. This is equivalent to the Python expression "int(object)".
public static AsInt ( PyObject value ) : PyInt
value PyObject
Результат PyInt

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

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

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

PyInt Constructor
Creates a new PyInt 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 PyInt ( IntPtr ptr ) : System
ptr System.IntPtr
Результат System

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

PyInt Constructor
Copy constructor - obtain a PyInt from a generic PyObject. An ArgumentException will be thrown if the given object is not a Python int object.
public PyInt ( PyObject o ) : System
o PyObject
Результат System

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

PyInt Constructor
Creates a new Python int from a byte value.
public PyInt ( byte value ) : System
value byte
Результат System

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

PyInt Constructor
Creates a new Python int from an int32 value.
public PyInt ( int value ) : System
value int
Результат System

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

PyInt Constructor
Creates a new Python int from an int64 value.
public PyInt ( long value ) : System
value long
Результат System

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

PyInt Constructor
Creates a new Python int from an int16 value.
public PyInt ( short value ) : System
value short
Результат System

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

PyInt Constructor
Creates a new Python int from a string value.
public PyInt ( string value ) : System
value string
Результат System

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

ToInt16 Method
Return the value of the Python int object as an int16.
public ToInt16 ( ) : short
Результат short

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

ToInt32 Method
Return the value of the Python int object as an int32.
public ToInt32 ( ) : int
Результат int

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

ToInt64 Method
Return the value of the Python int object as an int64.
public ToInt64 ( ) : long
Результат long