def set( self, key, value, indexed=True ):
"""
Sets a property.
:param key: key of the property to set.
:type key: str
:param value: Any value to set tot the property.
:param indexed: Defines if the value is indexed.
:type indexed: bool
:raises: :exc:`BadPropertyError` if the property name is the \
empty string or not a string.
:raises: :exc:`BadValueError` if the value is not a supported type.
"""
if not indexed:
unindexed = list( self.getUnindexedProperties() )
if not key in unindexed:
self.setUnindexedProperties( unindexed+[key] )
self[ key ] = value
评论列表
文章目录