Utils

POM utils

pom.utils.cache(func)[source]

Decorator to cache instance method execution result.

Note

It implements ordinary approach to cache function execution result. But also it uses as key not only function name but its id too. It’s related with inheritance specific, like that:

class A(object):

    @cache
    def meth(self):
        pass

class B(A):

    @cache
    def meth(self):
        pass

    @cache
    def _meth(self):
        super(A, self).meth()
pom.utils.camel2snake(string)[source]

Camel case to snake case converter.

pom.utils.log(func)[source]

Decorator to log function with arguments and execution time.

Note

It rejects self arguments from log messages.