Removes added attributes while leaving original attributes.
(self)
| 13 | return attr |
| 14 | |
| 15 | def resetcache(self): |
| 16 | "Removes added attributes while leaving original attributes." |
| 17 | # Function is really about resetting delegator dict |
| 18 | # to original state. Cache is just a means |
| 19 | for key in self.__cache: |
| 20 | try: |
| 21 | delattr(self, key) |
| 22 | except AttributeError: |
| 23 | pass |
| 24 | self.__cache.clear() |
| 25 | |
| 26 | def setdelegate(self, delegate): |
| 27 | "Reset attributes and change delegate." |