C# Class Python.Runtime.PyLong

Represents a Python long int object. See the documentation at http://www.python.org/doc/current/api/longObjects.html
Inheritance: PyNumber
Mostra file Open project: fkarb/pythonnet Class Usage Examples

Public Methods

Method Description
AsLong ( PyObject value ) : PyLong

AsLong Method

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

IsLongType ( PyObject value ) : bool

IsLongType Method

Returns true if the given object is a Python long.

PyLong ( IntPtr ptr ) : System

PyLong Constructor

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

PyLong ( PyObject o ) : System

PyLong Constructor

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

PyLong ( byte value ) : System

PyLong Constructor

Creates a new PyLong from a byte value.

PyLong ( double value ) : System

PyLong Constructor

Creates a new PyLong from an double value.

PyLong ( int value ) : System

PyLong Constructor

Creates a new PyLong from an int32 value.

PyLong ( long value ) : System

PyLong Constructor

Creates a new PyLong from an int64 value.

PyLong ( short value ) : System

PyLong Constructor

Creates a new PyLong from an int16 value.

PyLong ( string value ) : System

PyLong Constructor

Creates a new PyLong from a string value.

Private Methods

Method Description
PyLong ( sbyte value ) : System
PyLong ( uint value ) : System
PyLong ( ulong value ) : System
PyLong ( ushort value ) : System

Method Details

AsLong() public static method

AsLong Method
Convert a Python object to a Python long if possible, raising a PythonException if the conversion is not possible. This is equivalent to the Python expression "long(object)".
public static AsLong ( PyObject value ) : PyLong
value PyObject
return PyLong

IsLongType() public static method

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

PyLong() public method

PyLong Constructor
Creates a new PyLong 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 PyLong ( IntPtr ptr ) : System
ptr System.IntPtr
return System

PyLong() public method

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

PyLong() public method

PyLong Constructor
Creates a new PyLong from a byte value.
public PyLong ( byte value ) : System
value byte
return System

PyLong() public method

PyLong Constructor
Creates a new PyLong from an double value.
public PyLong ( double value ) : System
value double
return System

PyLong() public method

PyLong Constructor
Creates a new PyLong from an int32 value.
public PyLong ( int value ) : System
value int
return System

PyLong() public method

PyLong Constructor
Creates a new PyLong from an int64 value.
public PyLong ( long value ) : System
value long
return System

PyLong() public method

PyLong Constructor
Creates a new PyLong from an int16 value.
public PyLong ( short value ) : System
value short
return System

PyLong() public method

PyLong Constructor
Creates a new PyLong from a string value.
public PyLong ( string value ) : System
value string
return System