From ce47e42fd9f36fb4f9a13a4f6a79d1a93ab44408 Mon Sep 17 00:00:00 2001 From: Sean McLeod Date: Sun, 3 Dec 2023 14:54:14 +0200 Subject: [PATCH] Rename dictionary from properties to properties_cache --- python/jsbsim.pyx.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/jsbsim.pyx.in b/python/jsbsim.pyx.in index ad1bd2cd34..3344bcc3b2 100644 --- a/python/jsbsim.pyx.in +++ b/python/jsbsim.pyx.in @@ -674,7 +674,7 @@ cdef class FGFDMExec(FGJSBBase): """@Dox(JSBSim::FGFDMExec)""" cdef c_FGFDMExec *thisptr # hold a C++ instance which we're wrapping - cdef dict properties # Dictionary cache of property nodes + cdef dict properties_cache # Dictionary cache of property nodes def __cinit__(self, root_dir, FGPropertyManager pm_root=None, *args, **kwargs): @@ -702,7 +702,7 @@ cdef class FGFDMExec(FGJSBBase): self.set_aircraft_path("aircraft") self.set_systems_path("systems") - self.properties = { } + self.properties_cache = { } def __dealloc__(self) -> None: del self.thisptr @@ -724,13 +724,13 @@ cdef class FGFDMExec(FGJSBBase): def __getitem__(self, key: str) -> float: _key = key.strip() try: - property_node = self.properties[_key] + property_node = self.properties_cache[_key] return property_node.get_double_value() except KeyError: pm = self.get_property_manager() property_node = pm.get_node(_key) if property_node is not None: - self.properties[_key] = property_node + self.properties_cache[_key] = property_node return property_node.get_double_value() else: raise KeyError(f'No property named {_key}')