(self, name)
| 661 | return new_element |
| 662 | |
| 663 | def __getattr__(self, name): |
| 664 | if self._last_attribute_error: |
| 665 | # This means that we got here through a @property raising AttributeError. |
| 666 | # We therefore just re-raise the last AttributeError back to the user. |
| 667 | # Note that self._last_attribute_error was set by our specially |
| 668 | # instrumented @property decorator. |
| 669 | exc = self._last_attribute_error |
| 670 | self._last_attribute_error = None |
| 671 | raise exc # pylint: disable=raising-bad-type |
| 672 | elif name in self._spec.children: |
| 673 | return self.get_children(name) |
| 674 | elif name in self._spec.attributes: |
| 675 | return self._get_attribute(name) |
| 676 | elif name == constants.DCLASS and constants.CLASS in self._spec.attributes: |
| 677 | return self._get_attribute(constants.CLASS) |
| 678 | else: |
| 679 | raise AttributeError('object has no attribute: {}'.format(name)) |
| 680 | |
| 681 | def __setattr__(self, name, value): |
| 682 | # If this name corresponds to a descriptor for a slotted attribute or |
nothing calls this directly
no test coverage detected