AttributeDefinitionDictionary

class caris.AttributeDefinitionDictionary

A mutable dictionary of attributes.

The key is the attribute code. The value is an AttributeDefinition.

clear((AttributeDefinitionDictionary)self) → None :

Remove all items from the container.

get((AttributeDefinitionDictionary)self, (str)key[, (object)default=None]) → object :

Return the value for key if key is in the container

Parameters:
  • key (str) – The key of the item to return
  • default (AttributeDefinition) – If the key is not found this value will be returned
Returns:

A AttributeDefinition object. None if the key is not found and default was not specified

items((AttributeDefinitionDictionary)self) → list :

Return a new view of the container’s items

Returns:A new view of the container’s items (key, value) pairs
keys((AttributeDefinitionDictionary)self) → list :

Return a new view of the container’s keys

Returns:A new view of the container’s keys
pop((AttributeDefinitionDictionary)self, (str)key, (object)default) → object :

Remove an item

Args:
key (str): The key of the item to remove default (AttributeDefinition, optional): If the key is not found this value will be returned
Returns:
A AttributeDefinition object if the key is found
Raises:
A KeyError if the key is not found and a default value was not specified

pop( (AttributeDefinitionDictionary)arg1, (str)arg2) -> object

popitem((AttributeDefinitionDictionary)self) → tuple :

Remove and return an arbitrary (key, value) pair

Returns:An arbitrary (key, value) pair
Raises:A KeyError if the container is empty
setdefault((AttributeDefinitionDictionary)self, (str)key[, (object)default=None]) → object :

If key is found, return its value. If not, insert key with a value of default and return default.

Parameters:
  • key (str) – The key
  • default (AttributeDefinition) – If the key is not found this value will be inserted and returned
Returns:

A AttributeDefinition object

update((AttributeDefinitionDictionary)self, (object)other) → None :

Update the container with the key/value pairs from other, overwriting existing keys.

Parameters:other (AttributeDefinitionDictionary) – The other container to insert the key/value pairs from
values((AttributeDefinitionDictionary)self) → list :

Return a new view of the container’s items

Returns:A new view of the container’s items (key, value) pairs