Simple object for storing attributes. Implements equality by attribute names and values, and provides a simple string representation.
| 1164 | # =========================== |
| 1165 | |
| 1166 | class Namespace(_AttributeHolder): |
| 1167 | """Simple object for storing attributes. |
| 1168 | |
| 1169 | Implements equality by attribute names and values, and provides a simple |
| 1170 | string representation. |
| 1171 | """ |
| 1172 | |
| 1173 | def __init__(self, **kwargs): |
| 1174 | for name in kwargs: |
| 1175 | setattr(self, name, kwargs[name]) |
| 1176 | |
| 1177 | __hash__ = None |
| 1178 | |
| 1179 | def __eq__(self, other): |
| 1180 | return vars(self) == vars(other) |
| 1181 | |
| 1182 | def __ne__(self, other): |
| 1183 | return not (self == other) |
| 1184 | |
| 1185 | def __contains__(self, key): |
| 1186 | return key in self.__dict__ |
| 1187 | |
| 1188 | |
| 1189 | class _ActionsContainer(object): |