In some Python (v3) code I am creating lists of Decimals from user input, like this:
input = [] # later populated with strings by user with values like '1.45984000E+001'
decimals = [Decimal(c) for c in input]
However, sometimes the input list contains strings that cannot be parsed. How can I test if c can be represented as a decimal before calling the constructor?