Closed kierdavis closed 4 years ago
This is currently a dependency of zoloto
, so I have no issue adding it here.
Where would this be useful? It may be useful in some places but right now I'm struggling to think of any methods that are computationally intensive enough to benefit from this. Could we come up with a list of expensive methods to help whoever picks this up?
Coordinate.cylindrical
and Coordinate.spherical
are already using explicit caching. Switching to cached_property
would make the code a bit neater here.
It could also be used for Backend.firmware_version
, though I think most backends retrieve the firmware version during initialisation in order to check it is a supported version.
Coordinate.cylindrical
andCoordinate.spherical
are already using explicit caching. Switching tocached_property
would make the code a bit neater here.
I agree.
It could also be used for
Backend.firmware_version
, though I think most backends retrieve the firmware version during initialisation in order to check it is a supported version.
Thus the property is never fetched twice, the firmware version won't randomly change mid-execution.
It could also be used for
Backend.firmware_version
, though I think most backends retrieve the firmware version during initialisation in order to check it is a supported version.Thus the property is never fetched twice, the firmware version won't randomly change mid-execution.
Sorry, I completely bodged what I was trying to say there I think. That's correct. What I was aiming to say was that we could move the retrieval of the firmware version into the firmware_version
cached property itself, and then access it from the constructor if needed.
It could also be used for
Backend.firmware_version
, though I think most backends retrieve the firmware version during initialisation in order to check it is a supported version.Thus the property is never fetched twice, the firmware version won't randomly change mid-execution.
Sorry, I completely bodged what I was trying to say there I think. That's correct. What I was aiming to say was that we could move the retrieval of the firmware version into the
firmware_version
cached property itself, and then access it from the constructor if needed.
I don't think we're disagreeing :P
Moved to 1.0.0.
https://pypi.org/project/cached-property/