Internal utilities.
copyright: |
|
---|---|
license: | BSD, see LICENSE for more details. |
Generate a unique id, having - hopefully - a very small chance of collision.
For now this is provided by uuid.uuid4().
Retry the function over and over until max retries is exceeded.
For each retry we sleep a for a while before we try again, this interval is increased for every retry until the max seconds is reached.
Parameters: |
|
---|
Property descriptor that caches the return value of the get function.
Examples
@cached_property
def connection(self):
return Connection()
@connection.setter # Prepares stored value
def connection(self, value):
if value is None:
raise TypeError("Connection must be a connection")
return value
@connection.deleter
def connection(self, value):
# Additional action to do at del(self.attr)
if value is not None:
print("Connection %r deleted" % (value, ))
Combine multiple context managers into a single nested context manager.