File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 66"""
77
88from collections import UserList
9- from functools import lru_cache , cached_property
109from numpy import (
1110 pi ,
1211 where ,
4443from spatialmath .base import getvector
4544from spatialmath import SE3
4645from typing import Union , overload , List , Set
46+ from sys import version_info
4747
4848ArrayLike = Union [list , ndarray , tuple , set ]
4949
50+ py_ver = version_info
51+
52+ if version_info >= (3 , 9 ):
53+ from functools import cached_property
54+
55+ c_property = cached_property
56+ else :
57+ c_property = property
58+
5059
5160class BaseETS (UserList ):
5261 def __init__ (self , * args ):
@@ -238,7 +247,7 @@ def jindex_set(self) -> Set[int]: #
238247 """
239248 return set ([self [j ].jindex for j in self .joint_idx ()]) # type: ignore
240249
241- @cached_property
250+ @c_property
242251 def jindices (self ) -> ndarray :
243252 """
244253 Get an array of joint indices
@@ -255,7 +264,7 @@ def jindices(self) -> ndarray:
255264 """
256265 return array ([self [j ].jindex for j in self .joints ()]) # type: ignore
257266
258- @cached_property
267+ @c_property
259268 def qlim (self ):
260269 r"""
261270 Joint limits
You can’t perform that action at this time.
0 commit comments