Get current object. This is useful if you want the real object behind the proxy at a time for performance reasons or because you want to pass the object into a different context.
(self)
| 94 | return self._get_class() |
| 95 | |
| 96 | def _get_current_object(self): |
| 97 | """Get current object. |
| 98 | |
| 99 | This is useful if you want the real |
| 100 | object behind the proxy at a time for performance reasons or because |
| 101 | you want to pass the object into a different context. |
| 102 | """ |
| 103 | loc = object.__getattribute__(self, '_Proxy__local') |
| 104 | if not hasattr(loc, '__release_local__'): |
| 105 | return loc(*self.__args, **self.__kwargs) |
| 106 | try: # pragma: no cover |
| 107 | # not sure what this is about |
| 108 | return getattr(loc, self.__name__) |
| 109 | except AttributeError: # pragma: no cover |
| 110 | raise RuntimeError(f'no object bound to {self.__name__}') |
| 111 | |
| 112 | @property |
| 113 | def __dict__(self): |