Home | Trees | Indices | Help |
|
---|
|
object --+ | Proxy1ce
Decorator for a lazily evaluated dict or lazily imported module or singleton, avoiding circular imports and providing access to the dict's items or the singleton's or module's attributes.
See Also: Module Properties | the Proxy Pattern.
Instance Methods | |||
|
|||
|
|||
|
|||
Inherited from |
Properties | |
Inherited from |
Method Details |
New Proxy1ce.
Note:
The first key or attribute access of the decorated
Example: >>> @Proxy1ce >>> def _dict(): # no args >>> d = dict(...) # compute once >>> return d # singleton >>> >>> s = type(_dict) # Proxy1ce >>> x = _dict[k] >>> t = type(_dict) # type(d) >>> @Proxy1ce >>> def _singleton(): # no args >>> from somewhere import singleton >>> return singleton >>> >>> s = type(_singleton) # Proxy1ce >>> x = _singleton.attr >>> t = type(_singleton) # type(singleton) >>> @Proxy1ce >>> def _module(): # no args >>> import module as mod >>> return mod >>> >>> s = type(_module) # Proxy1ce >>> x = _module.attr >>> t = type(_module) # type(mod) |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Apr 8 11:26:16 2025 | http://epydoc.sourceforge.net |