def __setitem__(self, key, value, *args, **kwargs): """ This method sets a key and sibling attribute with given value. :param key: Key. ( Object ) :param value: Value. ( Object ) :param \*args: Arguments. ( \* ) :param \*\*kwargs: Key / Value pairs. ( Key / Value pairs ) """ OrderedDict.__setitem__(self, key, value, *args, **kwargs) OrderedDict.__setattr__(self, key, value)
def __setitem__(self, key, value, *args, **kwargs): """ Sets a key and sibling attribute with given value. :param key: Key. :type key: object :param value: Value. :type value: object :param \*args: Arguments. :type \*args: \* :param \*\*kwargs: Key / Value pairs. :type \*\*kwargs: dict """ OrderedDict.__setitem__(self, key, value, *args, **kwargs) OrderedDict.__setattr__(self, key, value)
def __setattr__(self, attribute, value): """ This method sets both key and sibling attribute with given value. :param attribute: Attribute. ( Object ) :param value: Value. ( Object ) """ if sys.version_info[:2] <= (2, 6): if not attribute in ("_OrderedDict__map", "_OrderedDict__end"): OrderedDict.__setitem__(self, attribute, value) else: if hasattr(self, "_OrderedDict__root") and hasattr( self, "_OrderedDict__map"): if self._OrderedDict__root: OrderedDict.__setitem__(self, attribute, value) OrderedDict.__setattr__(self, attribute, value)
def __setattr__(self, attribute, value): """ Sets both key and sibling attribute with given value. :param attribute: Attribute. :type attribute: object :param value: Value. :type value: object """ if sys.version_info[:2] <= (2, 6): if not attribute in ("_OrderedDict__map", "_OrderedDict__end"): OrderedDict.__setitem__(self, attribute, value) else: if hasattr(self, "_OrderedDict__root") and hasattr(self, "_OrderedDict__map"): if self._OrderedDict__root: OrderedDict.__setitem__(self, attribute, value) OrderedDict.__setattr__(self, attribute, value)