C# Class Python.Runtime.PyDict

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

Public Methods

Method Description
Clear ( ) : void

Clear Method

Clears the dictionary.

Copy ( ) : PyDict

Copy Method

Returns a copy of the dictionary.

HasKey ( PyObject key ) : bool

HasKey Method

Returns true if the object key appears in the dictionary.

HasKey ( string key ) : bool

HasKey Method

Returns true if the string key appears in the dictionary.

IsDictType ( PyObject value ) : bool

IsDictType Method

Returns true if the given object is a Python dictionary.

Items ( ) : PyObject

Items Method

Returns a sequence containing the items of the dictionary.

Keys ( ) : PyObject

Keys Method

Returns a sequence containing the keys of the dictionary.

PyDict ( ) : System

PyDict Constructor

Creates a new Python dictionary object.

PyDict ( IntPtr ptr ) : System

PyDict Constructor

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

PyDict ( PyObject o ) : System

PyDict Constructor

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

Update ( PyObject other ) : void

Update Method

Update the dictionary from another dictionary.

Values ( ) : PyObject

Values Method

Returns a sequence containing the values of the dictionary.

Method Details

Clear() public method

Clear Method
Clears the dictionary.
public Clear ( ) : void
return void

Copy() public method

Copy Method
Returns a copy of the dictionary.
public Copy ( ) : PyDict
return PyDict

HasKey() public method

HasKey Method
Returns true if the object key appears in the dictionary.
public HasKey ( PyObject key ) : bool
key PyObject
return bool

HasKey() public method

HasKey Method
Returns true if the string key appears in the dictionary.
public HasKey ( string key ) : bool
key string
return bool

IsDictType() public static method

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

Items() public method

Items Method
Returns a sequence containing the items of the dictionary.
public Items ( ) : PyObject
return PyObject

Keys() public method

Keys Method
Returns a sequence containing the keys of the dictionary.
public Keys ( ) : PyObject
return PyObject

PyDict() public method

PyDict Constructor
Creates a new Python dictionary object.
public PyDict ( ) : System
return System

PyDict() public method

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

PyDict() public method

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

Update() public method

Update Method
Update the dictionary from another dictionary.
public Update ( PyObject other ) : void
other PyObject
return void

Values() public method

Values Method
Returns a sequence containing the values of the dictionary.
public Values ( ) : PyObject
return PyObject