You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numpy as np
import abc
from cached_property import cached_property
class A(abc.ABC):
@abc.abstractmethod
@cached_property
def v1(self):
...
class B:
@cached_property # things dont work if we dont add this
def v1(self):
return np.random.randint(133)
np.random.seed(123)
a = B()
print(a.v1)
print(a.v1)
print(a.v1)
Output:
109
109
109
Can we have this code run where there is no need to have @cached_property decorator for child class B. Or do you think this is not useful to implement as it violates some coding principles as the property v1() will now appear as a method in child class B to all IDEs
The text was updated successfully, but these errors were encountered:
This is a feature request
Code:
Output:
Can we have this code run where there is no need to have
@cached_property
decorator for child classB
. Or do you think this is not useful to implement as it violates some coding principles as the propertyv1()
will now appear as a method in child classB
to all IDEsThe text was updated successfully, but these errors were encountered: