Is it possible to have a static property on a class that would be computed as a one off. The idea would be to be able to do it like so:
class Foo:
static_prop = Foo.one_off_static_method()
@staticmethod
def one_off_static_method():
return 'bar'
I thought of using __new__
as well.
Class Foo:
def __new__(cls):
cls.static_prop = ... do everything here
Not sure the implications of that though.