From bb8c23ce374e45ea62ebd2eaac20d16c9734a50a Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Mon, 3 Jul 2023 10:58:22 -0400 Subject: [PATCH] Correct Tuple type hints in nexus.py. Correcting typing hints declaring use of Tuple['T'] (for some T) but intending a tuple having any number of T objects (i.e. Tuple['T', ...]. --- python/hypy/nexus.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/hypy/nexus.py b/python/hypy/nexus.py index 0fc6c57..c55106f 100644 --- a/python/hypy/nexus.py +++ b/python/hypy/nexus.py @@ -9,7 +9,7 @@ class Nexus(): """ @classmethod - def _convert_collection_to_tuple(cls, collection: 'Catchments_Collection') -> Tuple['Catchment']: + def _convert_collection_to_tuple(cls, collection: 'Catchments_Collection') -> Tuple['Catchment', ...]: """ Convenience method to accept a ``Catchments_Collection``, which is a union of several possible types, and to output a tuple of catchments (or an empty tuple). @@ -20,7 +20,7 @@ def _convert_collection_to_tuple(cls, collection: 'Catchments_Collection') -> Tu a single catchment object itself. Returns ------- - Tuple['Catchment'] + Tuple['Catchment', ...] A tuple containing the catchments included directly or in the container parameter object. """ if isinstance(collection, list): @@ -69,23 +69,23 @@ def id(self) -> str: return self._id @property - def receiving_catchments (self) -> Tuple['Catchment']: + def receiving_catchments (self) -> Tuple['Catchment', ...]: """Tuple of Catchment object(s) receiving water from nexus Returns ------- - Tuple['Catchment'] + Tuple['Catchment', ...] Tuple of Catchment object(s) receiving water from nexus """ return self._receiving_catchments @property - def contributing_catchments (self) -> Tuple['Catchment']: + def contributing_catchments (self) -> Tuple['Catchment', ...]: """Tuple of Catchment object(s) contributing water to nexus Returns ------- - Tuple['Catchment'] + Tuple['Catchment', ...] Tuple of Catchment object(s) contributing water to nexus """ return self._contributing_catchments