I have an argument which is either "E" or "H".
def my_func(name):
"""
Parameters
----------
name : str
"""
To specify it's either 'E' or 'H' I've seen people writing:
name : {'E', 'H'}
name : ['E', 'H']
name : ['E' | 'H']
name : Union['E', 'H']
name : 'E' or 'H'
Or, putting those on the second line:
name : str
{'E', 'H'}
name : str
['E', 'H']
name : str
['E' | 'H']
name : str
Union['E', 'H']
name : str
'E' or 'H'
which one of the above is correct?
If it's int or float, which one of the following is correct?
param : int or float
param : Union[int, float]
param : [int | float]
param : {int, float}