Simple object for storing attributes. Implements equality by attribute names and values, and provides a simple string representation.
| 1469 | # =========================== |
| 1470 | |
| 1471 | class Namespace(_AttributeHolder): |
| 1472 | """Simple object for storing attributes. |
| 1473 | |
| 1474 | Implements equality by attribute names and values, and provides a simple |
| 1475 | string representation. |
| 1476 | """ |
| 1477 | |
| 1478 | def __init__(self, **kwargs): |
| 1479 | for name in kwargs: |
| 1480 | setattr(self, name, kwargs[name]) |
| 1481 | |
| 1482 | def __eq__(self, other): |
| 1483 | if not isinstance(other, Namespace): |
| 1484 | return NotImplemented |
| 1485 | return vars(self) == vars(other) |
| 1486 | |
| 1487 | def __contains__(self, key): |
| 1488 | return key in self.__dict__ |
| 1489 | |
| 1490 | |
| 1491 | class _ActionsContainer(object): |
no outgoing calls
no test coverage detected
searching dependent graphs…