As I try to use more and more functional programming (i.e. use classes less), I have noticed I start to use modules as classes:
#File foomod.py
foo = None
def get_foo():
    global foo
    if foo is None:
        foo = 1 + 1
    return foo
# main.py
import foomod
x = foomod.get_foo()
This might as well be
#File foo.py
class foo:
    foo = None
    @staticmethod
    def get_foo(cls):
        if cls.foo is None:
            cls.foo = 1 + 1
        return cls.foo
# main.py
from foo import Foo
x = Foo.get_foo()
Is there any reason to favour one over the other? E.g. speed or something else?
