In (some) @property functions, the access to other properties of the class are not detected as reasons for impurity.
Examples:
# seaborn_v0.12.2.external.version.is_devrelease.334.4
@property
def is_devrelease(self) -> bool:
return self.dev is not None # Impure Read from property dev is not detected
# pandas_v2.0.3.core.arrays.sparse.array.nbytes.667.4
@property
def nbytes(self) -> int:
return self.sp_values.nbytes + self.sp_index.nbytes # Impure Read from property sp_values and sp_index is not detected
To Reproduce
Run purity analysis on the libraries
Check the result file
Expected behavior
Access of propertys are impure and therefore must be detected as impure.
Therefore a special case needs to be implemented to deal with that.
Screenshots (optional)
No response
Additional Context (optional)
Since the tests were only done for a sample of functions, there could be more functions with the same problem.
Describe the bug
In (some)
@property
functions, the access to other properties of the class are not detected as reasons for impurity.Examples:
To Reproduce
Expected behavior
Access of propertys are impure and therefore must be detected as impure. Therefore a special case needs to be implemented to deal with that.
Screenshots (optional)
No response
Additional Context (optional)
Since the tests were only done for a sample of functions, there could be more functions with the same problem.