ESCOMP / CAM-SIMA

Community Atmosphere Model - System for Integrated Modeling of the Atmosphere
4 stars 12 forks source link

Replace "type()" with "type().__name__" in python error messages #159

Open nusbaume opened 3 years ago

nusbaume commented 3 years ago

During the CAMDEN configure and build stages there are numerous python type-checks which throw an error describing what the variable type is and what it should be. In general this is done using code like:

print(type(x))

Which if x is a string results in something like:

<class 'str'>

However, that could be confusing to users who are not particularly familiar with python. Instead one could do:

print(type(x).__name__))

which results in:

'str'

which would hopefully make the error message easier to understand, at least for non-python users.