csdms/bmi-python

Mistake in type hints for tuples

BSchilperoort opened this issue · 2 comments

The type hints of the Bmi class have a couple of return types as tuple[str]. For example:

def get_input_var_names(self) -> tuple[str]:

However, in python's typing system this means a tuple containing a single string. For a tuple of strings the correct type hint is:

    def get_input_var_names(self) -> tuple[str, ...]: 

To quote the Python documentation on this:

To denote a tuple which could be of any length, and in which all elements are of the same type T, use tuple[T, ...].

@BSchilperoort Thank you for catching this. I learned something new about type hints!

Fixed with #37.