From e0bf0951c75ab631b684727a027f42572fc805e0 Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Thu, 8 Feb 2024 23:13:30 -0800 Subject: [PATCH] Switch to streamlined Python3 super() --- helics/capi.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/helics/capi.py b/helics/capi.py index 9db55f5..948f5f9 100644 --- a/helics/capi.py +++ b/helics/capi.py @@ -986,7 +986,7 @@ def __delitem__(self, index): class HelicsFilter(_HelicsCHandle): def __init__(self, handle, cleanup=True): - super(HelicsFilter, self).__init__(handle, cleanup=cleanup) + super().__init__(handle, cleanup=cleanup) self.option = _FilterOptionAccessor(self.handle, cleanup=False) def __repr__(self): @@ -1060,7 +1060,7 @@ class HelicsCloningFilter(HelicsFilter): class HelicsTranslator(_HelicsCHandle): def __init__(self, handle, cleanup=True): - super(HelicsTranslator, self).__init__(handle, cleanup=cleanup) + super().__init__(handle, cleanup=cleanup) class HelicsCore(_HelicsCHandle): @@ -1365,7 +1365,7 @@ def __delitem__(self, index): class HelicsMessage(_HelicsCHandle): def __init__(self, handle, cleanup=True): - super(HelicsMessage, self).__init__(handle, cleanup=cleanup) + super().__init__(handle, cleanup=cleanup) self.flag = _MessageFlagAccessor(self.handle, cleanup=False) def __repr__(self): @@ -1608,8 +1608,7 @@ def __delitem__(self, index): class HelicsFederateInfo(_HelicsCHandle): def __init__(self, handle, cleanup=True): - # Python2 compatible super - super(HelicsFederateInfo, self).__init__(handle, cleanup) + super().__init__(handle, cleanup) self.property = _FederateInfoPropertyAccessor(self.handle, cleanup=False) self.flag = _FederateInfoFlagAccessor(self.handle, cleanup=False) @@ -1825,8 +1824,7 @@ def __delitem__(self, index): class HelicsFederate(_HelicsCHandle): def __init__(self, handle, cleanup=True): - # Python2 compatible super - super(HelicsFederate, self).__init__(handle, cleanup) + super().__init__(handle, cleanup) self._exec_async_iterate = False self.property = _FederatePropertyAccessor(self.handle, cleanup=False) @@ -2374,7 +2372,7 @@ def __delitem__(self, index): class HelicsInput(_HelicsCHandle): def __init__(self, handle): - super(HelicsInput, self).__init__(handle, cleanup=False) + super().__init__(handle, cleanup=False) self.option = _InputOptionAccessor(self.handle, cleanup=False) def __repr__(self): @@ -2579,7 +2577,7 @@ def info(self, info: str): class HelicsPublication(_HelicsCHandle): def __init__(self, handle): - super(HelicsPublication, self).__init__(handle, cleanup=False) + super().__init__(handle, cleanup=False) self.option = _PublicationOptionAccessor(self.handle, cleanup=False) def __repr__(self): @@ -2669,7 +2667,7 @@ def add_target(self, name: str): class HelicsValueFederate(HelicsFederate): def __init__(self, handle): - super(HelicsValueFederate, self).__init__(handle) + super().__init__(handle) for i in range(0, self.n_publications): pub = self.get_publication_by_index(i) @@ -2858,7 +2856,7 @@ def publish_json(self, data: Union[dict, str]): class HelicsMessageFederate(HelicsFederate): def __init__(self, handle): - super(HelicsMessageFederate, self).__init__(handle) + super().__init__(handle) for i in range(0, self.n_endpoints): end = self.get_endpoint_by_index(i)